Skip to content

Commit e6c8fcd

Browse files
Merge #2391
2391: Fix Singlepass issue #2347 r=syrusakbary a=chenyukang # Description Fix Singlepass compiler issue: #2347 I'm not sure whether the unit test case added to a suitable file. Any better suggestion? @syrusakbary Edit by @Hywan: Close #2347, close #2159. Co-authored-by: yukang <moorekang@gmail.com> Co-authored-by: Yukang <moorekang@gmail.com>
2 parents c879e2a + b99542b commit e6c8fcd

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C
7373
- [#2157](https://github.com/wasmerio/wasmer/pull/2157) Simplify the code behind `WasmPtr`
7474

7575
### Fixed
76+
- [#2391](https://github.com/wasmerio/wasmer/pull/2391) Fix Singlepass emit bug, [#2347](https://github.com/wasmerio/wasmer/issues/2347) and [#2159](https://github.com/wasmerio/wasmer/issues/2159)
7677
- [#2327](https://github.com/wasmerio/wasmer/pull/2327) Fix memory leak preventing internal instance memory from being freed when a WasmerEnv contained an exported extern (e.g. Memory, etc.).
7778
- [#2247](https://github.com/wasmerio/wasmer/pull/2247) Internal WasiFS logic updated to be closer to what WASI libc does when finding a preopened fd for a path.
7879
- [#2241](https://github.com/wasmerio/wasmer/pull/2241) Fix Undefined Behavior in setting memory in emscripten `EmEnv`.

lib/compiler-singlepass/src/codegen_x64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@ impl<'a> FuncGen<'a> {
330330
let tmp1 = self.machine.acquire_temp_xmm().unwrap();
331331
let tmp2 = self.machine.acquire_temp_xmm().unwrap();
332332
let tmp3 = self.machine.acquire_temp_xmm().unwrap();
333-
let tmpg1 = self.machine.acquire_temp_gpr().unwrap();
334333

335334
self.emit_relaxed_binop(Assembler::emit_mov, sz, input, Location::XMM(tmp1));
335+
let tmpg1 = self.machine.acquire_temp_gpr().unwrap();
336336

337337
match sz {
338338
Size::S32 => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
;; https://github.com/wasmerio/wasmer/issues/2159
2+
(module
3+
(func (export "_start") (result f64)
4+
f64.const 0x0p+0 (;=0;)
5+
f64.const 0x0p+0 (;=0;)
6+
f64.const 0x0p+0 (;=0;)
7+
f64.div
8+
f64.copysign
9+
)
10+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
;; https://github.com/wasmerio/wasmer/issues/2347
2+
(module
3+
(type (;0;) (func (param f64) (result i32)))
4+
(func (;0;) (type 0) (param f64) (result i32)
5+
unreachable)
6+
(func (;1;) (type 0) (param f64) (result i32)
7+
i32.const -16579585
8+
f64.convert_i32_s
9+
f64.ceil
10+
f64.ceil
11+
local.get 0
12+
f64.copysign
13+
unreachable))
14+

0 commit comments

Comments
 (0)