summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAsumu Takikawa <asumu@igalia.com>2021-12-15 16:24:32 -0800
committerGitHub <noreply@github.com>2021-12-15 16:24:32 -0800
commit5718b65c381cbed697712a87886fcbb0c3db36a8 (patch)
tree5deb7bee07dfd551b85ec7363eb8711e742d4305 /test
parentb3f1efb261b059d40a4d103c803ccbe3c32df7ae (diff)
downloadwabt-5718b65c381cbed697712a87886fcbb0c3db36a8.tar.gz
wabt-5718b65c381cbed697712a87886fcbb0c3db36a8.tar.bz2
wabt-5718b65c381cbed697712a87886fcbb0c3db36a8.zip
interpreter: Fix infinite looping on `return_call` (#1762)
The code offset fixup for the target of a `return_call` was not being done properly due to invalid initialization of the offset value, and due to the fixup location being put at the wrong offset in the instruction stream. Fixes issue #1761
Diffstat (limited to 'test')
-rw-r--r--test/interp/return-call-set-local.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/interp/return-call-set-local.txt b/test/interp/return-call-set-local.txt
new file mode 100644
index 00000000..5b566361
--- /dev/null
+++ b/test/interp/return-call-set-local.txt
@@ -0,0 +1,20 @@
+;;; TOOL: run-interp
+;;; ARGS*: --enable-tail-call
+(module
+ (func (export "f") (result i32)
+ (i64.const 1)
+ (return_call $g))
+
+ (func $g (param i64) (result i32)
+ (i32.const 3)
+ (return_call $h))
+
+ (func $h (param i32) (result i32)
+ (i32.const 2)
+ (local.set 0)
+ (local.get 0)
+ return)
+)
+(;; STDOUT ;;;
+f() => i32:2
+;;; STDOUT ;;)