Fix dev backend pointer bug

When using pointers as keys, new ones shouldn't get created. Always
reference an existing item.
This commit is contained in:
Brendan Hansknecht 2021-05-20 20:36:49 -07:00
parent 564aacc1fd
commit 1a98ec290e
2 changed files with 7 additions and 8 deletions

View file

@ -104,9 +104,9 @@ where
fail: _, fail: _,
} => { } => {
// for now, treat invoke as a normal call // for now, treat invoke as a normal call
self.build_expr(symbol, &Expr::Call(call.clone()), layout)?;
let stmt = Stmt::Let(*symbol, Expr::Call(call.clone()), *layout, pass); self.free_symbols(stmt);
self.build_stmt(&stmt) self.build_stmt(pass)
} }
Stmt::Switch { Stmt::Switch {
cond_symbol, cond_symbol,
@ -478,15 +478,15 @@ where
Stmt::Invoke { Stmt::Invoke {
symbol, symbol,
layout, layout: _,
call, call,
pass, pass,
fail: _, fail: _,
} => { } => {
// for now, treat invoke as a normal call // for now, treat invoke as a normal call
self.set_last_seen(*symbol, stmt);
let stmt = Stmt::Let(*symbol, Expr::Call(call.clone()), *layout, pass); self.scan_ast_call(call, stmt);
self.scan_ast(&stmt); self.scan_ast(pass);
} }
Stmt::Switch { Stmt::Switch {

View file

@ -89,7 +89,6 @@ mod gen_num {
} }
#[test] #[test]
#[ignore]
fn i64_force_stack() { fn i64_force_stack() {
// This claims 33 registers. One more than Arm and RISC-V, and many more than x86-64. // This claims 33 registers. One more than Arm and RISC-V, and many more than x86-64.
assert_evals_to!( assert_evals_to!(