When the const memory access is not larger than the minimum, use a runtime check.

The memory may have grown.
This commit is contained in:
Nick Lewycky
2019-11-01 12:49:54 -07:00
parent 9224db6d1e
commit 20270411d9

View File

@ -602,7 +602,7 @@ fn resolve_memory_ptr(
IntPredicate::ULE,
intrinsics.i64_ty.const_int(minimum.bytes().0 as u64, false),
);
if ptr_in_bounds.is_constant_int() {
if ptr_in_bounds.get_zero_extended_constant() == Some(1) {
Some(ptr_in_bounds)
} else {
None