alive2
alive2 copied to clipboard
Maximum objectsize is smaller than the actual object
For a 16-byte allocation, alive-exec evaluates the maximum object size as 0 instead of a value of at least 16.
Program
declare i64 @llvm.objectsize.i64.p0(ptr, i1 immarg, i1 immarg, i1 immarg)
define i32 @main() {
%p = alloca [16 x i8]
%s = call i64 @llvm.objectsize.i64.p0(ptr %p, i1 false, i1 true, i1 false)
%bad = icmp ult i64 %s, 16
%r = zext i1 %bad to i32
ret i32 %r
}
Output
Executing %#0
%p = #b01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
%s = #x0000000000000000
%bad = #b1
%r = #x00000001
Returned #x00000001 / non-poison=true