mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 22:25:40 +00:00
Merge #1034
1034: When modifying the value, also update its ExtraInfo. r=nlewycky a=nlewycky Fixes a debug_assert! on python3.7 and rustpython in wapm. Co-authored-by: Nick Lewycky <nick@wasmer.io>
This commit is contained in:
commit
183beb769e
@ -18,5 +18,23 @@ fn crash_return_with_float_on_stack() {
|
|||||||
"#;
|
"#;
|
||||||
let wasm_binary = wat2wasm(MODULE.as_bytes()).expect("WAST not valid or malformed");
|
let wasm_binary = wat2wasm(MODULE.as_bytes()).expect("WAST not valid or malformed");
|
||||||
let module = compile_with(&wasm_binary, &get_compiler()).unwrap();
|
let module = compile_with(&wasm_binary, &get_compiler()).unwrap();
|
||||||
let instance = module.instantiate(&imports! {}).unwrap();
|
module.instantiate(&imports! {}).unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn crash_select_with_mismatched_pending() {
|
||||||
|
const MODULE: &str = r#"
|
||||||
|
(module
|
||||||
|
(func (param f64)
|
||||||
|
f64.const 0x0p+0 (;=0;)
|
||||||
|
local.get 0
|
||||||
|
f64.add
|
||||||
|
f64.const 0x0p+0 (;=0;)
|
||||||
|
i32.const 0
|
||||||
|
select
|
||||||
|
drop))
|
||||||
|
"#;
|
||||||
|
let wasm_binary = wat2wasm(MODULE.as_bytes()).expect("WAST not valid or malformed");
|
||||||
|
let module = compile_with(&wasm_binary, &get_compiler()).unwrap();
|
||||||
|
module.instantiate(&imports! {}).unwrap();
|
||||||
}
|
}
|
||||||
|
@ -1730,15 +1730,17 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
|
|||||||
// If the pending bits of v1 and v2 are the same, we can pass
|
// If the pending bits of v1 and v2 are the same, we can pass
|
||||||
// them along to the result. Otherwise, apply pending
|
// them along to the result. Otherwise, apply pending
|
||||||
// canonicalizations now.
|
// canonicalizations now.
|
||||||
let (v1, v2) = if i1.has_pending_f32_nan() != i2.has_pending_f32_nan()
|
let (v1, i1, v2, i2) = if i1.has_pending_f32_nan() != i2.has_pending_f32_nan()
|
||||||
|| i1.has_pending_f64_nan() != i2.has_pending_f64_nan()
|
|| i1.has_pending_f64_nan() != i2.has_pending_f64_nan()
|
||||||
{
|
{
|
||||||
(
|
(
|
||||||
apply_pending_canonicalization(builder, intrinsics, v1, i1),
|
apply_pending_canonicalization(builder, intrinsics, v1, i1),
|
||||||
|
i1.strip_pending(),
|
||||||
apply_pending_canonicalization(builder, intrinsics, v2, i2),
|
apply_pending_canonicalization(builder, intrinsics, v2, i2),
|
||||||
|
i2.strip_pending(),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
(v1, v2)
|
(v1, i1, v2, i2)
|
||||||
};
|
};
|
||||||
let cond_value = builder.build_int_compare(
|
let cond_value = builder.build_int_compare(
|
||||||
IntPredicate::NE,
|
IntPredicate::NE,
|
||||||
|
Loading…
Reference in New Issue
Block a user