Issue 235723
Summary llubi accepts an argument that violates a dereferenceable_or_null call-site attribute
Labels new issue
Assignees
Reporter Roticv912
    A one-byte allocation is passed to a callee with dereferenceable(1) and a call site with dereferenceable_or_null(8) without reporting undefined behavior.

### Program
```llvm
define void @f(ptr dereferenceable(1) %p) { ret void }

define i32 @main() {
entry:
 %p = alloca i8
  call void @f(ptr dereferenceable_or_null(8) %p)
  ret i32 0
}
```

### Output
```
Entering function: main
  %p = alloca i8, align 1 => ptr 0x8 [p]
Entering function: f
  ptr %p = ptr 0x8 [p]
  ret void
Exiting function: f
  call void @f(ptr dereferenceable_or_null(8) %p)
  ret i32 0
Exiting function: main
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to