Commit c824426b authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Fixed bug in handling of return value from malloc

parent d11f957e
......@@ -1724,10 +1724,11 @@ impl<'a> InstructionSelection {
let const_size = self.make_int_const(size as u64, vm);
if vm.vm_options.flag_use_malloc {
let tmp_res = self.get_result_value(node);
self.emit_runtime_entry(
&entrypoints::MALLOC,
vec![const_size],
None,
Some(vec![tmp_res]),
Some(node),
f_content,
f_context,
......@@ -1839,10 +1840,11 @@ impl<'a> InstructionSelection {
};
if vm.vm_options.flag_use_malloc {
let tmp_res = self.get_result_value(node);
self.emit_runtime_entry(
&entrypoints::MALLOC,
vec![actual_size],
None,
Some(vec![tmp_res]),
Some(node),
f_content,
f_context,
......
......@@ -128,7 +128,7 @@ fn test_type_constructors() {
assert_type!(*types[13], "tagref64");
assert_type!(*types[14], "vector<int<8> 5>");
assert_type!(*types[15], "funcref<(int<8> int<8>)->(void)>");
assert_type!(*types[16], "ufuncref<(int<8> int<8>)->(void)>");
assert_type!(*types[16], "ufuncptr<(int<8> int<8>)->(void)>");
}
#[test]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment