Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(565)

Delta Between Two Patch Sets: test/Instrumentation/AddressSanitizer/OptKnownBounds/heap-free.ll

Issue 6643048: Add a known bounds optimization to ASan.
Left Patch Set: Created 11 years, 5 months ago
Right Patch Set: Match the DataLayout getIntPtrType change. Created 11 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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
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: }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b