mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-11 05:34:11 +03:00
wasm_interp: Fix bug where all arguments were being set as I32
This commit is contained in:
parent
1b126d3b58
commit
4cf5d19ace
@ -74,8 +74,18 @@ impl<'a> CallStack<'a> {
|
|||||||
// Pop arguments off the value stack and into locals
|
// Pop arguments off the value stack and into locals
|
||||||
for (i, type_byte) in arg_type_bytes.iter().copied().enumerate().rev() {
|
for (i, type_byte) in arg_type_bytes.iter().copied().enumerate().rev() {
|
||||||
let arg = value_stack.pop();
|
let arg = value_stack.pop();
|
||||||
assert_eq!(ValueType::from(arg), ValueType::from(type_byte));
|
let ty = ValueType::from(arg);
|
||||||
|
let expected_type = ValueType::from(type_byte);
|
||||||
|
assert_eq!(ty, expected_type);
|
||||||
self.set_local_help(i as u32, arg);
|
self.set_local_help(i as u32, arg);
|
||||||
|
self.is_64.set(
|
||||||
|
frame_offset + i,
|
||||||
|
matches!(ty, ValueType::I64 | ValueType::F64),
|
||||||
|
);
|
||||||
|
self.is_float.set(
|
||||||
|
frame_offset + i,
|
||||||
|
matches!(ty, ValueType::F32 | ValueType::F64),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.value_stack_bases.push(value_stack.len() as u32);
|
self.value_stack_bases.push(value_stack.len() as u32);
|
||||||
|
Loading…
Reference in New Issue
Block a user