Correct symbol capturing of crash

This commit is contained in:
Ayaz Hafiz 2022-11-22 16:27:40 -06:00
parent 220c8a8e64
commit d9a8cba821
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -5571,18 +5571,16 @@ pub fn with_hole<'a>(
TypedHole(_) => Stmt::RuntimeError("Hit a blank"), TypedHole(_) => Stmt::RuntimeError("Hit a blank"),
RuntimeError(e) => Stmt::RuntimeError(env.arena.alloc(e.runtime_message())), RuntimeError(e) => Stmt::RuntimeError(env.arena.alloc(e.runtime_message())),
Crash { msg, ret_var: _ } => { Crash { msg, ret_var: _ } => {
let msg_sym = env.unique_symbol(); let msg_sym = possible_reuse_symbol_or_specialize(
let stmt = Stmt::Crash(msg_sym, CrashTag::User);
with_hole(
env, env,
msg.value,
Variable::STR,
procs, procs,
layout_cache, layout_cache,
msg_sym, &msg.value,
env.arena.alloc(stmt), Variable::STR,
) );
let stmt = Stmt::Crash(msg_sym, CrashTag::User);
assign_to_symbol(env, procs, layout_cache, Variable::STR, *msg, msg_sym, stmt)
} }
} }
} }