Fix breaking change

This commit is contained in:
Lachlan Sneff
2018-06-15 18:42:33 -04:00
committed by Dan Gohman
parent 38ab82bcc0
commit f97ad59991

View File

@@ -6,7 +6,7 @@
use cursor::{Cursor, FuncCursor}; use cursor::{Cursor, FuncCursor};
use flowgraph::ControlFlowGraph; use flowgraph::ControlFlowGraph;
use ir::condcodes::IntCC; use ir::condcodes::IntCC;
use ir::{self, InstBuilder}; use ir::{self, InstBuilder, MemFlags};
use isa::TargetIsa; use isa::TargetIsa;
/// Expand a `heap_addr` instruction according to the definition of the heap. /// Expand a `heap_addr` instruction according to the definition of the heap.
@@ -57,7 +57,12 @@ fn dynamic_addr(
pos.use_srcloc(inst); pos.use_srcloc(inst);
// Start with the bounds check. Trap if `offset + size > bound`. // Start with the bounds check. Trap if `offset + size > bound`.
let bound = pos.ins().global_value(addr_ty, bound_gv); let bound_addr = pos.ins().global_value(addr_ty, bound_gv);
let mut mflags = MemFlags::new();
// The bound variable is requied to be accessible and aligned.
mflags.set_notrap();
mflags.set_aligned();
let bound = pos.ins().load(offset_ty, mflags, bound_addr, 0);
let oob; let oob;
if size == 1 { if size == 1 {
@@ -158,7 +163,12 @@ fn offset_addr(
match pos.func.heaps[heap].base { match pos.func.heaps[heap].base {
ir::HeapBase::ReservedReg => unimplemented!(), ir::HeapBase::ReservedReg => unimplemented!(),
ir::HeapBase::GlobalValue(base_gv) => { ir::HeapBase::GlobalValue(base_gv) => {
let base = pos.ins().global_value(addr_ty, base_gv); let base_addr = pos.ins().global_value(addr_ty, base_gv);
let mut mflags = MemFlags::new();
// The base address variable is requied to be accessible and aligned.
mflags.set_notrap();
mflags.set_aligned();
let base = pos.ins().load(addr_ty, mflags, base_addr, 0);
pos.func.dfg.replace(inst).iadd(base, offset); pos.func.dfg.replace(inst).iadd(base, offset);
} }
} }