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

View File

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