<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Labels in C allows to jump over llvm.lifetime.start"
href="https://llvm.org/bugs/show_bug.cgi?id=28267">28267</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Labels in C allows to jump over llvm.lifetime.start
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>vitalybuka@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>In code example we can jump over llvm.lifetime.start having only
llvm.lifetime.end for 'tmp'.
This is a problem for asan-use-after-scope check as memory can not be
unpoisoned as usual on llvm.lifetime.start.
source:
int res;
int* ptr;
void f(int cond) {
if (cond)
goto label;
{
int tmp;
label:
ptr = &tmp;
res = *ptr;
}
if (cond) {
cond = 0;
goto label;
}
}
llvm:
; Function Attrs: nounwind sanitize_address uwtable
define void @f(i32 %cond) #0 !dbg !11 {
%cond.addr = alloca i32, align 4
%tmp = alloca i32, align 4
store i32 %cond, i32* %cond.addr, align 4
%1 = load i32, i32* %cond.addr, align 4, !dbg !13
%tobool = icmp ne i32 %1, 0, !dbg !13
br i1 %tobool, label %2, label %3, !dbg !13
; <label>:2: ; preds = %0
br label %5, !dbg !14
; <label>:3: ; preds = %0
%4 = bitcast i32* %tmp to i8*, !dbg !15
call void @llvm.lifetime.start(i64 4, i8* %4) #2, !dbg !15
br label %5, !dbg !15
; <label>:5: ; preds = %10, %3, %2
store i32* %tmp, i32** @ptr, align 8, !dbg !16
%6 = load i32*, i32** @ptr, align 8, !dbg !17
%7 = load i32, i32* %6, align 4, !dbg !18
store i32 %7, i32* @res, align 4, !dbg !19
%8 = bitcast i32* %tmp to i8*, !dbg !20
call void @llvm.lifetime.end(i64 4, i8* %8) #2, !dbg !20
%9 = load i32, i32* %cond.addr, align 4, !dbg !21
%tobool1 = icmp ne i32 %9, 0, !dbg !21
br i1 %tobool1, label %10, label %11, !dbg !21
; <label>:10: ; preds = %5
store i32 0, i32* %cond.addr, align 4, !dbg !22
br label %5, !dbg !23
; <label>:11: ; preds = %5
ret void, !dbg !24
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>