fix for re-used DEV_TMP symbol

This commit is contained in:
Folkert 2023-05-02 21:03:20 +02:00
parent ce36069d57
commit ac64e4ab87
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 9 additions and 3 deletions

View file

@ -322,14 +322,16 @@ trait Backend<'a> {
}
fn roc_panic(&mut self, msg: Symbol, crash_tag: CrashTag) {
let error_message = self.debug_symbol("error_message");
self.load_literal(
&Symbol::DEV_TMP,
&error_message,
&Layout::U32,
&Literal::Int((crash_tag as u128).to_ne_bytes()),
);
// Now that the arguments are needed, load them if they are literals.
let arguments = &[msg, Symbol::DEV_TMP];
let arguments = &[msg, error_message];
self.load_literal_symbols(arguments);
self.build_fn_call(
&Symbol::DEV_TMP2,