gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

asan should support variable-sized alloca #138

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the LLVM instrumentation pass simply ignores the non-constant 
allocas: 
% cat alloca.c 
#include <stdlib.h>
void foo(char *x);
int bar(int n, int m) {
  char *x = alloca(n);
  foo(x);
  return x[m];
}
% clang -fsanitize=address -O2 -S -o - -emit-llvm  alloca.c 2>&1 | head -20 
...
define i32 @bar(i32 %n, i32 %m) nounwind uwtable address_safety {
entry:
  %conv = sext i32 %n to i64
  %0 = alloca i8, i64 %conv, align 1
  call void @foo(i8* %0) nounwind
...

Original issue reported on code.google.com by konstant...@gmail.com on 17 Dec 2012 at 1:28

GoogleCodeExporter commented 9 years ago
Issue 347 has been merged into this issue.

Original comment by konstant...@gmail.com on 29 Sep 2014 at 9:03

GoogleCodeExporter commented 9 years ago
Hi,

I'm starting the task implementation.

Original comment by chefM...@gmail.com on 24 Oct 2014 at 8:26