LEFT | RIGHT |
1 ; Invalid access of a freed heap object. | 1 ; Invalid access of a 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 noalias i32* @example(i64 %n) address_safety nounwind uwtable { | 9 define noalias 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 @free(i8* %call) nounwind | 13 tail call void @free(i8* %call) nounwind |
(...skipping 19 matching lines...) Expand all Loading... |
33 ; OPT0: @asan.module_ctor | 33 ; OPT0: @asan.module_ctor |
34 | 34 |
35 ; C-example: #include <stdlib.h> | 35 ; C-example: #include <stdlib.h> |
36 ; C-example: | 36 ; C-example: |
37 ; C-example: int* example(size_t n) { | 37 ; C-example: int* example(size_t n) { |
38 ; C-example: int *array = malloc(50 * sizeof(int)); | 38 ; C-example: int *array = malloc(50 * sizeof(int)); |
39 ; C-example: free(array); | 39 ; C-example: free(array); |
40 ; C-example: array[3] = n; // BUG | 40 ; C-example: array[3] = n; // BUG |
41 ; C-example: return array; | 41 ; C-example: return array; |
42 ; C-example: } | 42 ; C-example: } |
LEFT | RIGHT |