-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1191: Fix singlepass miscompilation on `Operator::CallIndirect`. r=losfair a=losfair This fixes the 3 failing tests mentioned in https://00f.net/2019/10/22/updated-webassembly-benchmark/ . (TODO: Add test cases?) Co-authored-by: losfair <zhy20000919@hotmail.com>
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
;; Wasmer-specific tests. | ||
|
||
(module | ||
;; Auxiliary definitions | ||
(type $out-i32 (func (result i32))) | ||
|
||
(func $const-i32 (type $out-i32) (i32.const 0x132)) | ||
|
||
(table funcref | ||
(elem | ||
$const-i32 | ||
) | ||
) | ||
|
||
;; https://github.com/wasmerio/wasmer/pull/1191 | ||
(func (export "call-indirect-from-spilled-stack") (result i32) | ||
(i64.add (i64.const 0) (i64.const 0)) | ||
(i64.add (i64.const 0) (i64.const 0)) | ||
(i64.add (i64.const 0) (i64.const 0)) | ||
(i64.add (i64.const 0) (i64.const 0)) | ||
(i64.add (i64.const 0) (i64.const 0)) | ||
(i64.add (i64.const 0) (i64.const 0)) | ||
(i64.add (i64.const 0) (i64.const 0)) | ||
(i64.add (i64.const 0) (i64.const 0)) | ||
(i64.add (i64.const 0) (i64.const 0)) | ||
(i64.add (i64.const 0x100000000) (i64.const 0)) | ||
(i32.wrap_i64) | ||
(call_indirect (type $out-i32)) | ||
(return) | ||
) | ||
) | ||
|
||
(assert_return (invoke "call-indirect-from-spilled-stack") (i32.const 0x132)) |