mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Wasm: Change panic for literals todo -> internal_error
This commit is contained in:
parent
91a0b21e70
commit
bafb6e54d0
1 changed files with 5 additions and 4 deletions
|
@ -1295,7 +1295,8 @@ impl<'a> WasmBackend<'a> {
|
||||||
sym: Symbol,
|
sym: Symbol,
|
||||||
layout: &Layout<'a>,
|
layout: &Layout<'a>,
|
||||||
) {
|
) {
|
||||||
let not_supported_error = || todo!("Literal value {:?}", lit);
|
let invalid_error =
|
||||||
|
|| internal_error!("Literal value {:?} has invalid storage {:?}", lit, storage);
|
||||||
|
|
||||||
match storage {
|
match storage {
|
||||||
StoredValue::VirtualMachineStack { value_type, .. } => {
|
StoredValue::VirtualMachineStack { value_type, .. } => {
|
||||||
|
@ -1306,7 +1307,7 @@ impl<'a> WasmBackend<'a> {
|
||||||
(Literal::Int(x), ValueType::I32) => self.code_builder.i32_const(*x as i32),
|
(Literal::Int(x), ValueType::I32) => self.code_builder.i32_const(*x as i32),
|
||||||
(Literal::Bool(x), ValueType::I32) => self.code_builder.i32_const(*x as i32),
|
(Literal::Bool(x), ValueType::I32) => self.code_builder.i32_const(*x as i32),
|
||||||
(Literal::Byte(x), ValueType::I32) => self.code_builder.i32_const(*x as i32),
|
(Literal::Byte(x), ValueType::I32) => self.code_builder.i32_const(*x as i32),
|
||||||
_ => not_supported_error(),
|
_ => invalid_error(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1369,11 +1370,11 @@ impl<'a> WasmBackend<'a> {
|
||||||
self.code_builder.i32_store(Align::Bytes4, offset + 4);
|
self.code_builder.i32_store(Align::Bytes4, offset + 4);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
_ => not_supported_error(),
|
_ => invalid_error(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_ => not_supported_error(),
|
_ => invalid_error(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue