LEFT | RIGHT |
1 ; Invalid access of a possibly freed heap object. | 1 ; Invalid access of a possibly freed heap object. |
2 | 2 |
3 ; RUN: opt < %s -asan -S -asan-opt=1 | FileCheck %s -check-prefix=OPT1 | 3 ; RUN: opt < %s -asan -S -asan-opt=1 -asan-opt-known-bounds=1 | FileCheck %s -ch
eck-prefix=OPT1 |
4 ; RUN: opt < %s -asan -S -asan-opt=0 | FileCheck %s -check-prefix=OPT0 | 4 ; RUN: opt < %s -asan -S -asan-opt=0 | FileCheck %s -check-prefix=OPT0 |
5 | 5 |
6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
2:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:6
4-S128" | 6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
2:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:6
4-S128" |
7 target triple = "x86_64-unknown-linux-gnu" | 7 target triple = "x86_64-unknown-linux-gnu" |
8 | 8 |
9 define i32* @example(i64 %n) address_safety nounwind uwtable { | 9 define i32* @example(i64 %n) address_safety nounwind uwtable { |
10 entry: | 10 entry: |
11 %call = tail call noalias i8* @malloc(i64 200) nounwind | 11 %call = tail call noalias i8* @malloc(i64 200) nounwind |
12 %0 = bitcast i8* %call to i32* | 12 %0 = bitcast i8* %call to i32* |
13 tail call void @unknown_function(i32* %0) nounwind | 13 tail call void @unknown_function(i32* %0) nounwind |
(...skipping 28 matching lines...) Expand all Loading... |
42 ; C-example: | 42 ; C-example: |
43 ; C-example: void unknown_function(int* ptr); | 43 ; C-example: void unknown_function(int* ptr); |
44 ; C-example: | 44 ; C-example: |
45 ; C-example: int* example(size_t n) { | 45 ; C-example: int* example(size_t n) { |
46 ; C-example: int *array = malloc(50 * sizeof(int)); | 46 ; C-example: int *array = malloc(50 * sizeof(int)); |
47 ; C-example: unknown_function(array); | 47 ; C-example: unknown_function(array); |
48 ; C-example: if(array) | 48 ; C-example: if(array) |
49 ; C-example: array[3] = 4; // BUG (if unknown_function frees array) | 49 ; C-example: array[3] = 4; // BUG (if unknown_function frees array) |
50 ; C-example: return array; | 50 ; C-example: return array; |
51 ; C-example: } | 51 ; C-example: } |
LEFT | RIGHT |