dataset
stringclasses 1
value | file
stringlengths 27
83
| fun_name
stringlengths 7
83
| llvm_ir_function
stringlengths 61
8.29k
| label
stringclasses 2
values |
|---|---|---|---|---|
juliet-test-suite-c
|
CWE191_Integer_Underflow__unsigned_int_fscanf_sub_05-good
|
goodB2G1
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%sv_0 = alloca i32, align 4
%0 = call i64 @FUNC(i64 40)
store i32 0, i32* %sv_0, align 4
%1 = load i32, i32* @gv_0, align 4
%2 = icmp eq i32 %1, 0
br i1 %2, label LBL_2, label LBL_1
LBL_1:
%3 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8
%4 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i32* nonnull %sv_0)
br label LBL_2
LBL_2:
%5 = load i32, i32* @gv_3, align 4
%6 = icmp eq i32 %5, 0
br i1 %6, label LBL_4, label LBL_3
LBL_3:
%7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_4 to i64))
br label LBL_7
LBL_4:
%8 = load i32, i32* %sv_0, align 4
%9 = icmp eq i32 %8, 0
br i1 %9, label LBL_6, label LBL_5
LBL_5:
%10 = add i32 %8, -1
%11 = zext i32 %10 to i64
%12 = call i64 @FUNC(i64 %11)
br label LBL_7
LBL_6:
%13 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_5 to i64))
br label LBL_7
LBL_7:
%14 = call i64 @FUNC(i64 40)
%15 = icmp eq i64 %0, %14
store i64 0, i64* %rax.0.reg2mem
br i1 %15, label LBL_9, label LBL_8
LBL_8:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_9
LBL_9:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i32* %sv_0, { 1, 2, 0 }
}
|
0
|
juliet-test-suite-c
|
CWE191_Integer_Underflow__int64_t_rand_predec_14-good
|
goodB2G1
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%sv_0.0.reg2mem = alloca i64
%0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4
%1 = icmp eq i32 %0, 5
%2 = icmp eq i1 %1, false
store i64 0, i64* %sv_0.0.reg2mem
br i1 %2, label LBL_2, label LBL_1
LBL_1:
%3 = call i32 @rand()
%4 = urem i32 %3, 2
%5 = icmp eq i32 %4, 0
%6 = call i32 @rand()
%7 = zext i32 %6 to i64
%8 = mul i64 %7, 1152921504606846976
%9 = call i32 @rand()
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 35184372088832
%12 = call i32 @rand()
%13 = sext i32 %12 to i64
%14 = mul i64 %13, 1073741824
%15 = call i32 @rand()
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 32768
%18 = call i32 @rand()
%19 = sext i32 %18 to i64
%20 = sext i1 %5 to i64
%21 = xor i64 %8, %20
%22 = xor i64 %21, %11
%23 = xor i64 %22, %14
%24 = xor i64 %23, %17
%storemerge = xor i64 %24, %19
store i64 %storemerge, i64* %sv_0.0.reg2mem
br label LBL_2
LBL_2:
%25 = load i32, i32* @gv_0, align 4
%26 = icmp eq i32 %25, 5
br i1 %26, label LBL_4, label LBL_3
LBL_3:
%27 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))
store i64 %27, i64* %rax.0.reg2mem
br label LBL_7
LBL_4:
%sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem
%28 = icmp eq i64 %sv_0.0.reload, -9223372036854775808
br i1 %28, label LBL_6, label LBL_5
LBL_5:
%29 = add i64 %sv_0.0.reload, -1
%30 = call i64 @FUNC(i64 %29)
store i64 %30, i64* %rax.0.reg2mem
br label LBL_7
LBL_6:
%31 = call i64 @FUNC(i64 ptrtoint ([54 x i8]* @gv_2 to i64))
store i64 %31, i64* %rax.0.reg2mem
br label LBL_7
LBL_7:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i64* %rax.0.reg2mem, { 0, 3, 2, 1 }
}
|
0
|
juliet-test-suite-c
|
CWE191_Integer_Underflow__int_connect_socket_sub_11-good
|
goodB2G2
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%sv_0.1.reg2mem = alloca i32
%sv_0.0.ph.reg2mem = alloca i32
%sv_1 = alloca i64, align 8
%sv_2 = alloca i64, align 8
%sv_3 = alloca i64, align 8
%0 = call i64 @FUNC(i64 40)
%1 = call i64 @FUNC()
%2 = trunc i64 %1 to i32
%3 = icmp eq i32 %2, 0
store i32 0, i32* %sv_0.1.reg2mem
br i1 %3, label LBL_6, label LBL_1
LBL_1:
%4 = call i32 @socket(i32 2, i32 1, i32 6)
%5 = icmp eq i32 %4, -1
store i32 0, i32* %sv_0.1.reg2mem
br i1 %5, label LBL_6, label LBL_2
LBL_2:
%6 = call i64* @memset(i64* nonnull %sv_2, i32 0, i32 16)
store i64 2, i64* %sv_2, align 8
%7 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))
%8 = call i16 @htons(i16 27015)
%9 = bitcast i64* %sv_2 to %sockaddr*
%10 = call i32 @connect(i32 %4, %sockaddr* nonnull %9, i32 16)
%11 = icmp eq i32 %10, -1
store i32 0, i32* %sv_0.0.ph.reg2mem
br i1 %11, label LBL_5, label LBL_3
LBL_3:
%12 = call i32 @recv(i32 %4, i64* nonnull %sv_1, i32 13, i32 0)
%13 = add i32 %12, 1
%14 = icmp ult i32 %13, 2
store i32 0, i32* %sv_0.0.ph.reg2mem
br i1 %14, label LBL_5, label LBL_4
LBL_4:
%15 = ptrtoint i64* %sv_3 to i64
%16 = sext i32 %12 to i64
%17 = add i64 %15, -22
%18 = add i64 %17, %16
%19 = inttoptr i64 %18 to i8*
store i8 0, i8* %19, align 1
%20 = bitcast i64* %sv_1 to i8*
%21 = call i32 @atoi(i8* nonnull %20)
store i32 %21, i32* %sv_0.0.ph.reg2mem
br label LBL_5
LBL_5:
%sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem
%22 = call i32 @close(i32 %4)
store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem
br label LBL_6
LBL_6:
%23 = call i64 @FUNC()
%24 = trunc i64 %23 to i32
%25 = icmp eq i32 %24, 0
br i1 %25, label LBL_10, label LBL_7
LBL_7:
%sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem
%26 = icmp eq i32 %sv_0.1.reload, -2147483648
br i1 %26, label LBL_9, label LBL_8
LBL_8:
%27 = add i32 %sv_0.1.reload, -1
%28 = zext i32 %27 to i64
%29 = call i64 @FUNC(i64 %28)
br label LBL_10
LBL_9:
%30 = call i64 @FUNC(i64 ptrtoint ([48 x i8]* @gv_1 to i64))
br label LBL_10
LBL_10:
%31 = call i64 @FUNC(i64 40)
%32 = icmp eq i64 %0, %31
store i64 0, i64* %rax.0.reg2mem
br i1 %32, label LBL_12, label LBL_11
LBL_11:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_12
LBL_12:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i32 %12, { 1, 0 }
uselistorder i32 %4, { 2, 0, 1, 3 }
uselistorder i64* %sv_2, { 0, 2, 1 }
uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 2, 1 }
uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }
uselistorder i32 (i32)* @close, { 1, 0, 2 }
uselistorder i32 (i8*)* @atoi, { 1, 0, 2 }
uselistorder i32 (i32, i64*, i32, i32)* @recv, { 1, 0, 2 }
uselistorder i32 (i32, %sockaddr*, i32)* @connect, { 1, 0, 2 }
uselistorder i16 (i16)* @htons, { 1, 0, 2 }
uselistorder i32 (i8*)* @inet_addr, { 1, 0, 2 }
uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }
uselistorder label LBL_6, { 1, 0, 2 }
uselistorder label LBL_5, { 1, 2, 0 }
}
|
0
|
juliet-test-suite-c
|
CWE127_Buffer_Underread__malloc_char_loop_13-bad
|
CWE127_Buffer_Underread__malloc_char_loop_13_bad
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%storemerge1.reg2mem = alloca i64
%sv_0.0.reg2mem = alloca i64
%sv_1 = alloca i64, align 8
%0 = call i64 @FUNC(i64 40)
%1 = load i32, i32* inttoptr (i64 8336 to i32*), align 16
%2 = icmp eq i32 %1, 5
%3 = icmp eq i1 %2, false
store i64 0, i64* %sv_0.0.reg2mem
br i1 %3, label LBL_4, label LBL_1
LBL_1:
%4 = call i64* @malloc(i32 100)
%5 = icmp eq i64* %4, null
%6 = icmp eq i1 %5, false
br i1 %6, label LBL_3, label LBL_2
LBL_2:
call void @exit(i32 -1)
unreachable
LBL_3:
%7 = ptrtoint i64* %4 to i64
%8 = call i64* @memset(i64* %4, i32 65, i32 99)
%9 = add i64 %7, 99
%10 = inttoptr i64 %9 to i8*
store i8 0, i8* %10, align 1
%11 = add i64 %7, -8
store i64 %11, i64* %sv_0.0.reg2mem
br label LBL_4
LBL_4:
%sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem
%12 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)
%13 = ptrtoint i64* %sv_1 to i64
store i64 0, i64* %storemerge1.reg2mem
br label LBL_5
LBL_5:
%storemerge1.reload = load i64, i64* %storemerge1.reg2mem
%14 = add i64 %storemerge1.reload, %sv_0.0.reload
%15 = inttoptr i64 %14 to i8*
%16 = load i8, i8* %15, align 1
%17 = add i64 %storemerge1.reload, %13
%18 = inttoptr i64 %17 to i8*
store i8 %16, i8* %18, align 1
%19 = add nuw nsw i64 %storemerge1.reload, 1
%exitcond = icmp eq i64 %19, 100
store i64 %19, i64* %storemerge1.reg2mem
br i1 %exitcond, label LBL_6, label LBL_5
LBL_6:
%20 = call i64 @FUNC(i64* nonnull %sv_1)
%21 = call i64 @FUNC(i64 40)
%22 = icmp eq i64 %0, %21
store i64 0, i64* %rax.0.reg2mem
br i1 %22, label LBL_8, label LBL_7
LBL_7:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_8
LBL_8:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i64 %storemerge1.reload, { 0, 2, 1 }
uselistorder i64* %4, { 0, 2, 1 }
uselistorder i64* %sv_1, { 0, 2, 1 }
uselistorder i64* %storemerge1.reg2mem, { 1, 0, 2 }
uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }
}
|
1
|
juliet-test-suite-c
|
CWE457_Use_of_Uninitialized_Variable__struct_array_malloc_no_init_12-good
|
goodB2G
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.4.reg2mem = alloca i64
%indvars.iv.reg2mem = alloca i64
%indvars.iv10.reg2mem = alloca i64
%indvars.iv13.reg2mem = alloca i64
%indvars.iv16.reg2mem = alloca i64
%0 = call i64* @malloc(i32 80)
%1 = icmp eq i64* %0, null
%2 = icmp eq i1 %1, false
br i1 %2, label LBL_2, label LBL_1
LBL_1:
call void @exit(i32 -1)
unreachable
LBL_2:
%3 = ptrtoint i64* %0 to i64
%4 = call i64 @FUNC()
%5 = call i64 @FUNC()
%6 = trunc i64 %5 to i32
%7 = icmp eq i32 %6, 0
store i64 0, i64* %indvars.iv16.reg2mem
store i64 0, i64* %indvars.iv10.reg2mem
br i1 %7, label LBL_5, label LBL_3
LBL_3:
%indvars.iv16.reload = load i64, i64* %indvars.iv16.reg2mem
%8 = mul i64 %indvars.iv16.reload, 8
%9 = add i64 %8, %3
%10 = inttoptr i64 %9 to i32*
%11 = trunc i64 %indvars.iv16.reload to i32
store i32 %11, i32* %10, align 4
%12 = add i64 %9, 4
%13 = inttoptr i64 %12 to i32*
store i32 %11, i32* %13, align 4
%indvars.iv.next17 = add nuw nsw i64 %indvars.iv16.reload, 1
%exitcond18 = icmp eq i64 %indvars.iv.next17, 10
store i64 %indvars.iv.next17, i64* %indvars.iv16.reg2mem
store i64 0, i64* %indvars.iv13.reg2mem
br i1 %exitcond18, label LBL_4, label LBL_3
LBL_4:
%indvars.iv13.reload = load i64, i64* %indvars.iv13.reg2mem
%14 = mul i64 %indvars.iv13.reload, 8
%15 = add i64 %14, %3
%16 = inttoptr i64 %15 to i32*
%17 = load i32, i32* %16, align 4
%18 = zext i32 %17 to i64
%19 = call i64 @FUNC(i64 %18)
%20 = add i64 %15, 4
%21 = inttoptr i64 %20 to i32*
%22 = load i32, i32* %21, align 4
%23 = zext i32 %22 to i64
%24 = call i64 @FUNC(i64 %23)
%indvars.iv.next14 = add nuw nsw i64 %indvars.iv13.reload, 1
%exitcond15 = icmp eq i64 %indvars.iv.next14, 10
store i64 %indvars.iv.next14, i64* %indvars.iv13.reg2mem
store i64 %24, i64* %rax.4.reg2mem
br i1 %exitcond15, label LBL_7, label LBL_4
LBL_5:
%indvars.iv10.reload = load i64, i64* %indvars.iv10.reg2mem
%25 = mul i64 %indvars.iv10.reload, 8
%26 = add i64 %25, %3
%27 = inttoptr i64 %26 to i32*
%28 = trunc i64 %indvars.iv10.reload to i32
store i32 %28, i32* %27, align 4
%29 = add i64 %26, 4
%30 = inttoptr i64 %29 to i32*
store i32 %28, i32* %30, align 4
%indvars.iv.next11 = add nuw nsw i64 %indvars.iv10.reload, 1
%exitcond12 = icmp eq i64 %indvars.iv.next11, 10
store i64 %indvars.iv.next11, i64* %indvars.iv10.reg2mem
store i64 0, i64* %indvars.iv.reg2mem
br i1 %exitcond12, label LBL_6, label LBL_5
LBL_6:
%indvars.iv.reload = load i64, i64* %indvars.iv.reg2mem
%31 = mul i64 %indvars.iv.reload, 8
%32 = add i64 %31, %3
%33 = inttoptr i64 %32 to i32*
%34 = load i32, i32* %33, align 4
%35 = zext i32 %34 to i64
%36 = call i64 @FUNC(i64 %35)
%37 = add i64 %32, 4
%38 = inttoptr i64 %37 to i32*
%39 = load i32, i32* %38, align 4
%40 = zext i32 %39 to i64
%41 = call i64 @FUNC(i64 %40)
%indvars.iv.next = add nuw nsw i64 %indvars.iv.reload, 1
%exitcond = icmp eq i64 %indvars.iv.next, 10
store i64 %indvars.iv.next, i64* %indvars.iv.reg2mem
store i64 %41, i64* %rax.4.reg2mem
br i1 %exitcond, label LBL_7, label LBL_6
LBL_7:
%rax.4.reload = load i64, i64* %rax.4.reg2mem
ret i64 %rax.4.reload
uselistorder i64* %0, { 1, 0 }
uselistorder i64* %indvars.iv16.reg2mem, { 2, 0, 1 }
uselistorder i64* %indvars.iv13.reg2mem, { 2, 0, 1 }
uselistorder i64* %indvars.iv10.reg2mem, { 2, 0, 1 }
uselistorder i64* %indvars.iv.reg2mem, { 2, 0, 1 }
uselistorder i64* %rax.4.reg2mem, { 0, 2, 1 }
uselistorder label LBL_7, { 1, 0 }
uselistorder label LBL_6, { 1, 0 }
uselistorder label LBL_5, { 1, 0 }
uselistorder label LBL_4, { 1, 0 }
uselistorder label LBL_3, { 1, 0 }
}
|
0
|
juliet-test-suite-c
|
CWE127_Buffer_Underread__malloc_char_ncpy_14-bad
|
CWE127_Buffer_Underread__malloc_char_ncpy_14_bad
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%sv_0.0.reg2mem = alloca i8*
%sv_1 = alloca i64, align 8
%0 = call i64 @FUNC(i64 40)
%1 = load i32, i32* inttoptr (i64 16404 to i32*), align 4
%2 = icmp eq i32 %1, 5
%3 = icmp eq i1 %2, false
store i8* null, i8** %sv_0.0.reg2mem
br i1 %3, label LBL_4, label LBL_1
LBL_1:
%4 = call i64* @malloc(i32 100)
%5 = icmp eq i64* %4, null
%6 = icmp eq i1 %5, false
br i1 %6, label LBL_3, label LBL_2
LBL_2:
call void @exit(i32 -1)
unreachable
LBL_3:
%7 = ptrtoint i64* %4 to i64
%8 = call i64* @memset(i64* %4, i32 65, i32 99)
%9 = add i64 %7, 99
%10 = inttoptr i64 %9 to i8*
store i8 0, i8* %10, align 1
%11 = add i64 %7, -8
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %sv_0.0.reg2mem
br label LBL_4
LBL_4:
%sv_0.0.reload = load i8*, i8** %sv_0.0.reg2mem
%13 = call i64* @memset(i64* nonnull %sv_1, i32 67, i32 99)
%14 = bitcast i64* %sv_1 to i8*
%15 = call i32 @strlen(i8* nonnull %14)
%16 = call i8* @strncpy(i8* nonnull %14, i8* %sv_0.0.reload, i32 %15)
%17 = call i64 @FUNC(i64* nonnull %sv_1)
%18 = call i64 @FUNC(i64 40)
%19 = icmp eq i64 %0, %18
store i64 0, i64* %rax.0.reg2mem
br i1 %19, label LBL_6, label LBL_5
LBL_5:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_6
LBL_6:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i64* %4, { 0, 2, 1 }
uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }
}
|
1
|
juliet-test-suite-c
|
CWE484_Omitted_Break_Statement_in_Switch__basic_08-bad
|
CWE484_Omitted_Break_Statement_in_Switch__basic_08_bad
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%0 = call i64 @FUNC()
%1 = trunc i64 %0 to i32
%2 = icmp eq i32 %1, 0
store i64 %0, i64* %rax.0.reg2mem
br i1 %2, label LBL_8, label LBL_1
LBL_1:
%3 = call i32 @rand()
%4 = srem i32 %3, 3
%5 = icmp eq i32 %4, 2
br i1 %5, label LBL_6, label LBL_2
LBL_2:
br i1 false, label LBL_7, label LBL_3
LBL_3:
switch i32 %4, label LBL_7 [
i32 0, label LBL_4
i32 1, label LBL_5
]
LBL_4:
%6 = call i64 @FUNC(i64 ptrtoint (i64* @gv_0 to i64))
br label LBL_5
LBL_5:
%7 = call i64 @FUNC(i64 ptrtoint (i64* @gv_1 to i64))
store i64 %7, i64* %rax.0.reg2mem
br label LBL_8
LBL_6:
%8 = call i64 @FUNC(i64 ptrtoint (i64* @gv_2 to i64))
store i64 %8, i64* %rax.0.reg2mem
br label LBL_8
LBL_7:
%9 = call i64 @FUNC(i64 ptrtoint ([15 x i8]* @gv_3 to i64))
store i64 %9, i64* %rax.0.reg2mem
br label LBL_8
LBL_8:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i32 %4, { 1, 0 }
uselistorder i64* %rax.0.reg2mem, { 0, 2, 3, 1, 4 }
uselistorder label LBL_5, { 1, 0 }
}
|
1
|
juliet-test-suite-c
|
CWE191_Integer_Underflow__int_fscanf_multiply_07-good
|
goodB2G1
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%.reg2mem = alloca i32
%sv_0 = alloca i64, align 8
%0 = call i64 @FUNC(i64 40)
store i64 0, i64* %sv_0, align 8
%1 = load i32, i32* @gv_0, align 4
%2 = icmp eq i32 %1, 5
%3 = icmp eq i1 %2, false
store i32 %1, i32* %.reg2mem
br i1 %3, label LBL_2, label LBL_1
LBL_1:
%4 = load %_IO_FILE*, %_IO_FILE** @gv_1, align 8
%5 = call i32 (%_IO_FILE*, i8*, ...) @fscanf(%_IO_FILE* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @gv_2, i64 0, i64 0), i64* nonnull %sv_0)
%.pr = load i32, i32* @gv_0, align 4
store i32 %.pr, i32* %.reg2mem
br label LBL_2
LBL_2:
%.reload = load i32, i32* %.reg2mem
%6 = icmp eq i32 %.reload, 5
br i1 %6, label LBL_4, label LBL_3
LBL_3:
%7 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))
br label LBL_8
LBL_4:
%8 = load i64, i64* %sv_0, align 8
%9 = trunc i64 %8 to i32
%10 = icmp slt i32 %9, 0
%11 = icmp eq i1 %10, false
br i1 %11, label LBL_8, label LBL_5
LBL_5:
%12 = icmp slt i32 %9, -1073741823
br i1 %12, label LBL_7, label LBL_6
LBL_6:
%13 = mul i64 %8, 2
%14 = and i64 %13, 4294967294
%15 = call i64 @FUNC(i64 %14)
br label LBL_8
LBL_7:
%16 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_4 to i64))
br label LBL_8
LBL_8:
%17 = call i64 @FUNC(i64 40)
%18 = icmp eq i64 %0, %17
store i64 0, i64* %rax.0.reg2mem
br i1 %18, label LBL_10, label LBL_9
LBL_9:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_10
LBL_10:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i64* %sv_0, { 1, 0, 2 }
uselistorder i32* %.reg2mem, { 0, 2, 1 }
}
|
0
|
juliet-test-suite-c
|
CWE124_Buffer_Underwrite__char_alloca_memcpy_05-good
|
goodG2B1
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%sv_0 = alloca i64, align 8
%sv_1 = alloca i64, align 8
%0 = ptrtoint i64* %sv_1 to i64
%1 = call i64 @FUNC(i64 40)
%2 = add i64 %0, -97
%3 = and i64 %2, -16
%4 = inttoptr i64 %3 to i64*
%5 = call i64* @memset(i64* %4, i32 65, i32 99)
%6 = add i64 %3, 99
%7 = inttoptr i64 %6 to i8*
store i8 0, i8* %7, align 1
%8 = load i32, i32* @gv_0, align 4
%9 = icmp eq i32 %8, 0
br i1 %9, label LBL_2, label LBL_1
LBL_1:
%10 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_1 to i64))
br label LBL_3
LBL_2:
store i64 %3, i64* %sv_1, align 8
br label LBL_3
LBL_3:
%11 = call i64* @memset(i64* nonnull %sv_0, i32 67, i32 99)
%12 = load i64, i64* %sv_1, align 8
%13 = load i64, i64* %sv_0, align 8
%14 = inttoptr i64 %12 to i64*
store i64 %13, i64* %14, align 8
%15 = add i64 %12, 8
%16 = inttoptr i64 %15 to i64*
%17 = add i64 %12, 16
%18 = inttoptr i64 %17 to i64*
%19 = add i64 %12, 24
%20 = inttoptr i64 %19 to i64*
%21 = add i64 %12, 32
%22 = inttoptr i64 %21 to i64*
%23 = add i64 %12, 40
%24 = inttoptr i64 %23 to i64*
%25 = add i64 %12, 48
%26 = inttoptr i64 %25 to i64*
%27 = add i64 %12, 56
%28 = inttoptr i64 %27 to i64*
%29 = add i64 %12, 64
%30 = inttoptr i64 %29 to i64*
%31 = add i64 %12, 72
%32 = inttoptr i64 %31 to i64*
%33 = add i64 %12, 80
%34 = inttoptr i64 %33 to i64*
%35 = add i64 %12, 88
%36 = inttoptr i64 %35 to i64*
%37 = add i64 %12, 96
%38 = inttoptr i64 %37 to i32*
%39 = load i64, i64* %sv_1, align 8
%40 = add i64 %39, 99
%41 = inttoptr i64 %40 to i8*
store i8 0, i8* %41, align 1
%42 = load i64, i64* %sv_1, align 8
%43 = call i64 @FUNC(i64 %42)
%44 = call i64 @FUNC(i64 40)
%45 = icmp eq i64 %1, %44
store i64 0, i64* %rax.0.reg2mem
br i1 %45, label LBL_5, label LBL_4
LBL_4:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_5
LBL_5:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i64 %12, { 12, 4, 11, 1, 10, 9, 8, 7, 6, 5, 3, 2, 0 }
uselistorder i64 %3, { 0, 2, 1 }
uselistorder i64* %sv_0, { 1, 0 }
}
|
0
|
juliet-test-suite-c
|
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_14-bad
|
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_14_bad
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%sv_0.1.reg2mem = alloca i32
%sv_0.0.ph.reg2mem = alloca i32
%sv_1 = alloca i64, align 8
%sv_2 = alloca i64, align 8
%sv_3 = alloca i64, align 8
%sv_4 = alloca i64, align 8
%0 = ptrtoint i64* %sv_4 to i64
%1 = call i64 @FUNC(i64 40)
%2 = load i32, i32* inttoptr (i64 16404 to i32*), align 4
%3 = icmp eq i32 %2, 5
%4 = icmp eq i1 %3, false
store i32 0, i32* %sv_0.1.reg2mem
br i1 %4, label LBL_7, label LBL_1
LBL_1:
%5 = call i32 @socket(i32 2, i32 1, i32 6)
%6 = icmp eq i32 %5, -1
store i32 0, i32* %sv_0.1.reg2mem
br i1 %6, label LBL_7, label LBL_2
LBL_2:
%7 = call i64* @memset(i64* nonnull %sv_3, i32 0, i32 16)
store i64 2, i64* %sv_3, align 8
%8 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @gv_0, i64 0, i64 0))
%9 = call i16 @htons(i16 27015)
%10 = bitcast i64* %sv_3 to %sockaddr*
%11 = call i32 @connect(i32 %5, %sockaddr* nonnull %10, i32 16)
%12 = icmp eq i32 %11, -1
store i32 0, i32* %sv_0.0.ph.reg2mem
br i1 %12, label LBL_6, label LBL_3
LBL_3:
%13 = call i32 @recv(i32 %5, i64* nonnull %sv_2, i32 7, i32 0)
%14 = add i32 %13, 1
%15 = icmp ult i32 %14, 2
store i32 0, i32* %sv_0.0.ph.reg2mem
br i1 %15, label LBL_6, label LBL_4
LBL_4:
%16 = sext i32 %13 to i64
%17 = add i64 %0, -112
%18 = add i64 %17, %16
%19 = inttoptr i64 %18 to i8*
store i8 0, i8* %19, align 1
%20 = bitcast i64* %sv_2 to i8*
%21 = call i32 @atoi(i8* nonnull %20)
%.off = add i32 %21, 32768
%22 = icmp ult i32 %.off, 65536
store i32 -1, i32* %sv_0.0.ph.reg2mem
br i1 %22, label LBL_5, label LBL_6
LBL_5:
%sext3 = mul i32 %21, 65536
%23 = ashr exact i32 %sext3, 16
store i32 %23, i32* %sv_0.0.ph.reg2mem
br label LBL_6
LBL_6:
%sv_0.0.ph.reload = load i32, i32* %sv_0.0.ph.reg2mem
%24 = call i32 @close(i32 %5)
store i32 %sv_0.0.ph.reload, i32* %sv_0.1.reg2mem
br label LBL_7
LBL_7:
%sv_0.1.reload = load i32, i32* %sv_0.1.reg2mem
store i64 0, i64* %sv_2, align 8
%25 = call i64* @memset(i64* nonnull %sv_1, i32 65, i32 99)
%26 = trunc i32 %sv_0.1.reload to i16
%27 = icmp sgt i16 %26, 99
br i1 %27, label LBL_9, label LBL_8
LBL_8:
%28 = call i64* @memcpy(i64* nonnull %sv_2, i64* nonnull %sv_1, i32 %sv_0.1.reload)
%29 = sext i32 %sv_0.1.reload to i64
%30 = add i64 %0, -112
%31 = add i64 %30, %29
%32 = inttoptr i64 %31 to i8*
store i8 0, i8* %32, align 1
br label LBL_9
LBL_9:
%33 = call i64 @FUNC(i64* nonnull %sv_2)
%34 = call i64 @FUNC(i64 40)
%35 = icmp eq i64 %1, %34
store i64 0, i64* %rax.0.reg2mem
br i1 %35, label LBL_11, label LBL_10
LBL_10:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_11
LBL_11:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i32 %sv_0.1.reload, { 1, 2, 0 }
uselistorder i32 %13, { 1, 0 }
uselistorder i32 %5, { 2, 0, 1, 3 }
uselistorder i64 %0, { 1, 0 }
uselistorder i64* %sv_3, { 0, 2, 1 }
uselistorder i64* %sv_2, { 0, 1, 4, 2, 3 }
uselistorder i32* %sv_0.0.ph.reg2mem, { 0, 3, 4, 2, 1 }
uselistorder i32* %sv_0.1.reg2mem, { 0, 2, 1, 3 }
uselistorder i64* (i64*, i32, i32)* @memset, { 1, 0, 2 }
uselistorder label LBL_7, { 1, 0, 2 }
uselistorder label LBL_6, { 2, 0, 3, 1 }
}
|
1
|
juliet-test-suite-c
|
CWE690_NULL_Deref_From_Return__int64_t_realloc_08-bad
|
CWE690_NULL_Deref_From_Return__int64_t_realloc_08_bad
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%0 = call i64* @realloc(i64* null, i32 8)
%1 = call i64 @FUNC()
%2 = trunc i64 %1 to i32
%3 = icmp eq i32 %2, 0
store i64 %1, i64* %rax.0.reg2mem
br i1 %3, label LBL_2, label LBL_1
LBL_1:
store i64 5, i64* %0, align 8
%4 = call i64 @FUNC(i64 5)
call void @free(i64* %0)
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_2
LBL_2:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
}
|
1
|
juliet-test-suite-c
|
CWE457_Use_of_Uninitialized_Variable__int_pointer_12-good
|
goodG2B
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%0 = call i64 @FUNC()
%1 = trunc i64 %0 to i32
%2 = icmp eq i32 %1, 0
%3 = call i64* @malloc(i32 4)
%4 = icmp eq i64* %3, null
%5 = icmp eq i1 %4, false
br i1 %2, label LBL_3, label LBL_1
LBL_1:
br i1 %5, label LBL_5, label LBL_2
LBL_2:
call void @exit(i32 -1)
unreachable
LBL_3:
br i1 %5, label LBL_5, label LBL_4
LBL_4:
call void @exit(i32 -1)
unreachable
LBL_5:
%6 = bitcast i64* %3 to i32*
store i32 5, i32* %6, align 4
%7 = call i64 @FUNC()
%8 = load i32, i32* %6, align 4
%9 = zext i32 %8 to i64
%10 = call i64 @FUNC(i64 %9)
ret i64 %10
uselistorder i32* %6, { 1, 0 }
uselistorder i1 %5, { 1, 0 }
uselistorder i64* %3, { 1, 0 }
uselistorder i64 (i64)* @printIntLine, { 2, 1, 0 }
uselistorder void (i32)* @exit, { 1, 3, 0, 2, 4 }
uselistorder i64* (i32)* @malloc, { 1, 0, 2 }
uselistorder i64 ()* @globalReturnsTrueOrFalse, { 3, 2, 1, 0 }
}
|
0
|
juliet-test-suite-c
|
CWE590_Free_Memory_Not_on_Heap__free_char_declare_07-good
|
goodG2B2
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%sv_0.0.reg2mem = alloca i64
%0 = load i32, i32* @gv_0, align 4
%1 = icmp eq i32 %0, 5
%2 = icmp eq i1 %1, false
store i64 0, i64* %sv_0.0.reg2mem
br i1 %2, label LBL_4, label LBL_1
LBL_1:
%3 = call i64* @malloc(i32 100)
%4 = icmp eq i64* %3, null
%5 = icmp eq i1 %4, false
br i1 %5, label LBL_3, label LBL_2
LBL_2:
%6 = call i64 @FUNC(i64 ptrtoint ([16 x i8]* @gv_1 to i64))
call void @exit(i32 1)
unreachable
LBL_3:
%7 = ptrtoint i64* %3 to i64
%8 = call i64* @memset(i64* %3, i32 65, i32 99)
%9 = add i64 %7, 99
%10 = inttoptr i64 %9 to i8*
store i8 0, i8* %10, align 1
store i64 %7, i64* %sv_0.0.reg2mem
br label LBL_4
LBL_4:
%sv_0.0.reload = load i64, i64* %sv_0.0.reg2mem
%11 = call i64 @FUNC(i64 %sv_0.0.reload)
%12 = inttoptr i64 %sv_0.0.reload to i64*
call void @free(i64* %12)
ret i64 ptrtoint (i32* @1 to i64)
uselistorder i64* %3, { 0, 2, 1 }
uselistorder void (i64*)* @free, { 1, 0, 2 }
uselistorder void (i32)* @exit, { 1, 0, 2 }
uselistorder i32* @gv_0, { 1, 0 }
}
|
0
|
juliet-test-suite-c
|
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14-bad
|
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14_bad
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%sv_0.0.reg2mem = alloca i32
%0 = load i32, i32* inttoptr (i64 16404 to i32*), align 4
%1 = icmp eq i32 %0, 5
%2 = icmp eq i1 %1, false
store i32 0, i32* %sv_0.0.reg2mem
br i1 %2, label LBL_2, label LBL_1
LBL_1:
%3 = call i32 @rand()
store i32 %3, i32* %sv_0.0.reg2mem
br label LBL_2
LBL_2:
%4 = load i32, i32* @gv_0, align 4
%5 = zext i32 %4 to i64
%6 = icmp eq i32 %4, 5
%7 = icmp eq i1 %6, false
store i64 %5, i64* %rax.0.reg2mem
br i1 %7, label LBL_8, label LBL_3
LBL_3:
%sv_0.0.reload = load i32, i32* %sv_0.0.reg2mem
%8 = icmp ult i32 %sv_0.0.reload, 6
br i1 %8, label LBL_7, label LBL_4
LBL_4:
%9 = call i64* @malloc(i32 %sv_0.0.reload)
%10 = icmp eq i64* %9, null
%11 = icmp eq i1 %10, false
br i1 %11, label LBL_6, label LBL_5
LBL_5:
call void @exit(i32 -1)
unreachable
LBL_6:
%12 = ptrtoint i64* %9 to i64
%13 = bitcast i64* %9 to i32*
store i32 1819043176, i32* %13, align 4
%14 = add i64 %12, 4
%15 = inttoptr i64 %14 to i16*
store i16 111, i16* %15, align 2
%16 = call i64 @FUNC(i64 %12)
call void @free(i64* %9)
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_8
LBL_7:
%17 = call i64 @FUNC(i64 ptrtoint ([51 x i8]* @gv_1 to i64))
store i64 %17, i64* %rax.0.reg2mem
br label LBL_8
LBL_8:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i64* %9, { 0, 1, 3, 2 }
uselistorder i64* %rax.0.reg2mem, { 0, 2, 1, 3 }
}
|
1
|
juliet-test-suite-c
|
CWE134_Uncontrolled_Format_String__char_environment_printf_05-good
|
goodB2G1
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%sv_0 = alloca i64, align 8
%0 = call i64 @FUNC(i64 40)
store i64 0, i64* %sv_0, align 8
%1 = bitcast i64* %sv_0 to i8*
%2 = load i32, i32* @gv_0, align 4
%3 = icmp eq i32 %2, 0
br i1 %3, label LBL_3, label LBL_1
LBL_1:
%4 = call i32 @strlen(i8* nonnull %1)
%5 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @gv_1, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label LBL_3, label LBL_2
LBL_2:
%7 = sext i32 %4 to i64
%8 = ptrtoint i64* %sv_0 to i64
%9 = add i64 %7, %8
%10 = inttoptr i64 %9 to i8*
%11 = sub i32 99, %4
%12 = call i8* @strncat(i8* %10, i8* nonnull %5, i32 %11)
br label LBL_3
LBL_3:
%13 = load i32, i32* @gv_2, align 4
%14 = icmp eq i32 %13, 0
br i1 %14, label LBL_5, label LBL_4
LBL_4:
%15 = call i64 @FUNC(i64 ptrtoint ([21 x i8]* @gv_3 to i64))
br label LBL_6
LBL_5:
%16 = call i32 @puts(i8* nonnull %1)
br label LBL_6
LBL_6:
%17 = call i64 @FUNC(i64 40)
%18 = icmp eq i64 %0, %17
store i64 0, i64* %rax.0.reg2mem
br i1 %18, label LBL_8, label LBL_7
LBL_7:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_8
LBL_8:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
}
|
0
|
juliet-test-suite-c
|
CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_07-bad
|
CWE121_Stack_Based_Buffer_Overflow__CWE805_int_alloca_memcpy_07_bad
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%0 = alloca i64
%rax.0.reg2mem = alloca i64
%sv_0 = alloca i64, align 8
%1 = load i64, i64* %0
%sv_1 = alloca i64, align 8
%2 = ptrtoint i64* %sv_1 to i64
%3 = call i64 @FUNC(i64 40)
%4 = add i64 %2, -193
%5 = and i64 %4, -16
%6 = load i32, i32* @gv_0, align 4
%7 = icmp eq i32 %6, 5
%8 = icmp eq i1 %7, false
%spec.select = select i1 %8, i64 %1, i64 %5
%9 = bitcast i64* %sv_0 to i8*
call void @FUNC(i8* nonnull %9, i64 0, i64 50)
%10 = inttoptr i64 %spec.select to i64*
%11 = call i64* @memcpy(i64* %10, i64* nonnull %sv_0, i32 400)
%12 = inttoptr i64 %spec.select to i32*
%13 = load i32, i32* %12, align 4
%14 = zext i32 %13 to i64
%15 = call i64 @FUNC(i64 %14)
%16 = call i64 @FUNC(i64 40)
%17 = icmp eq i64 %3, %16
store i64 0, i64* %rax.0.reg2mem
br i1 %17, label LBL_2, label LBL_1
LBL_1:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_2
LBL_2:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
}
|
1
|
juliet-test-suite-c
|
CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_16-bad
|
CWE134_Uncontrolled_Format_String__char_listen_socket_snprintf_16_bad
|
define i64 @FUNC() local_unnamed_addr {
LBL_0:
%rax.0.reg2mem = alloca i64
%sv_0 = alloca i64, align 8
%sv_1 = alloca i64, align 8
%sv_2 = alloca i64, align 8
%0 = call i64 @FUNC(i64 40)
store i64 0, i64* %sv_2, align 8
%1 = bitcast i64* %sv_2 to i8*
%2 = call i32 @strlen(i8* nonnull %1)
%3 = call i32 @socket(i32 2, i32 1, i32 6)
%4 = icmp eq i32 %3, -1
br i1 %4, label LBL_11, label LBL_1
LBL_1:
%5 = call i64* @memset(i64* nonnull %sv_1, i32 0, i32 16)
store i64 2, i64* %sv_1, align 8
%6 = call i16 @htons(i16 27015)
%7 = bitcast i64* %sv_1 to %sockaddr*
%8 = call i32 @bind(i32 %3, %sockaddr* nonnull %7, i32 16)
%9 = icmp eq i32 %8, -1
br i1 %9, label LBL_9, label LBL_2
LBL_2:
%10 = call i32 @listen(i32 %3, i32 5)
%11 = icmp eq i32 %10, -1
br i1 %11, label LBL_9, label LBL_3
LBL_3:
%12 = call i32 @accept(i32 %3, %sockaddr* null, i32* null)
%13 = icmp eq i32 %12, -1
br i1 %13, label LBL_9, label LBL_4
LBL_4:
%14 = sext i32 %2 to i64
%15 = ptrtoint i64* %sv_2 to i64
%16 = add i64 %14, %15
%17 = inttoptr i64 %16 to i64*
%18 = sub i32 99, %2
%19 = call i32 @recv(i32 %12, i64* %17, i32 %18, i32 0)
%20 = add i32 %19, 1
%21 = icmp ult i32 %20, 2
br i1 %21, label LBL_10, label LBL_5
LBL_5:
%22 = sext i32 %19 to i64
%23 = add i64 %16, %22
%24 = inttoptr i64 %23 to i8*
store i8 0, i8* %24, align 1
%25 = call i8* @strchr(i8* nonnull %1, i32 13)
%26 = icmp eq i8* %25, null
br i1 %26, label LBL_7, label LBL_6
LBL_6:
store i8 0, i8* %25, align 1
br label LBL_7
LBL_7:
%27 = call i8* @strchr(i8* nonnull %1, i32 10)
%28 = icmp eq i8* %27, null
br i1 %28, label LBL_10, label LBL_8
LBL_8:
store i8 0, i8* %27, align 1
br label LBL_10
LBL_9:
%29 = call i32 @close(i32 %3)
br label LBL_11
LBL_10:
%30 = call i32 @close(i32 %3)
%31 = call i32 @close(i32 %12)
br label LBL_11
LBL_11:
store i64 0, i64* %sv_0, align 8
%32 = bitcast i64* %sv_0 to i8*
%33 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* nonnull %32, i32 99, i8* nonnull %1)
%34 = call i64 @FUNC(i64* nonnull %sv_0)
%35 = call i64 @FUNC(i64 40)
%36 = icmp eq i64 %0, %35
store i64 0, i64* %rax.0.reg2mem
br i1 %36, label LBL_13, label LBL_12
LBL_12:
call void @__stack_chk_fail()
store i64 ptrtoint (i32* @1 to i64), i64* %rax.0.reg2mem
br label LBL_13
LBL_13:
%rax.0.reload = load i64, i64* %rax.0.reg2mem
ret i64 %rax.0.reload
uselistorder i32 %19, { 1, 0 }
uselistorder i32 %3, { 4, 0, 1, 2, 3, 5 }
uselistorder i8* %1, { 2, 0, 1, 3 }
uselistorder i64* %sv_1, { 0, 2, 1 }
uselistorder i32 (i32)* @close, { 1, 2, 0, 3 }
uselistorder i8* (i8*, i32)* @strchr, { 1, 0, 2 }
uselistorder i32 99, { 1, 0 }
uselistorder label LBL_11, { 2, 1, 0 }
}
|
1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.