Fix bug resulting from comparing the memory base instead of the memory offset to the memory bounds.

This commit is contained in:
Lachlan Sneff 2019-03-03 22:11:40 -08:00
parent ae3b2b2a42
commit ab550f46fc

View File

@ -2033,8 +2033,12 @@ fn resolve_memory_ptr(
let base_as_int = builder.build_ptr_to_int(base, intrinsics.i64_ty, "base_as_int");
let base_in_bounds =
builder.build_int_compare(IntPredicate::ULT, base_as_int, bounds, "base_in_bounds");
let base_in_bounds = builder.build_int_compare(
IntPredicate::ULT,
effective_offset,
bounds,
"base_in_bounds",
);
let base_in_bounds = builder
.build_call(