summaryrefslogtreecommitdiff
path: root/test/roundtrip
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2018-08-15 14:26:00 -0700
committerGitHub <noreply@github.com>2018-08-15 14:26:00 -0700
commit33f758c6b43f52ea5d74cc9579c63e62de4ec33d (patch)
tree27ef60511ba675f1dfc8f58874903f1df29458b1 /test/roundtrip
parent0d683b182258b1e04cbbcfb319f0107b6790df36 (diff)
downloadwabt-33f758c6b43f52ea5d74cc9579c63e62de4ec33d.tar.gz
wabt-33f758c6b43f52ea5d74cc9579c63e62de4ec33d.tar.bz2
wabt-33f758c6b43f52ea5d74cc9579c63e62de4ec33d.zip
Fix: set_global on immutable global is invalid (#895)
There is a spec test for this, but spectest-interp only runs the validator in `binary-reader-interp.cc`, which is different than the validator in `validator.cc`. This is necessarily so, since some checks only make sense when the module is linked or instantiated. This fixes issue #894.
Diffstat (limited to 'test/roundtrip')
-rw-r--r--test/roundtrip/fold-getset-global.txt8
-rw-r--r--test/roundtrip/generate-global-names.txt4
2 files changed, 6 insertions, 6 deletions
diff --git a/test/roundtrip/fold-getset-global.txt b/test/roundtrip/fold-getset-global.txt
index 122c2a60..0766f397 100644
--- a/test/roundtrip/fold-getset-global.txt
+++ b/test/roundtrip/fold-getset-global.txt
@@ -1,8 +1,8 @@
;;; TOOL: run-roundtrip
;;; ARGS: --stdout --fold-exprs
(module
- (global i32 (i32.const 1))
- (global f32 (f32.const 1.5))
+ (global (mut i32) (i32.const 1))
+ (global (mut f32) (f32.const 1.5))
(func $fold-get-global (result i32)
get_global 1
@@ -36,6 +36,6 @@
(i32.const 1)))
(set_global 1
(f32.const 0x1p+1 (;=2;))))
- (global (;0;) i32 (i32.const 1))
- (global (;1;) f32 (f32.const 0x1.8p+0 (;=1.5;))))
+ (global (;0;) (mut i32) (i32.const 1))
+ (global (;1;) (mut f32) (f32.const 0x1.8p+0 (;=1.5;))))
;;; STDOUT ;;)
diff --git a/test/roundtrip/generate-global-names.txt b/test/roundtrip/generate-global-names.txt
index a0e0ce78..e97bbf21 100644
--- a/test/roundtrip/generate-global-names.txt
+++ b/test/roundtrip/generate-global-names.txt
@@ -2,7 +2,7 @@
;;; ARGS: --stdout --generate-names
(module
(global i32 (i32.const 42))
- (global f32 (f32.const -1.5))
+ (global (mut f32) (f32.const -1.5))
(func (result i32)
f32.const 3.0
set_global 1
@@ -15,5 +15,5 @@
set_global $g1
get_global $g0)
(global $g0 i32 (i32.const 42))
- (global $g1 f32 (f32.const -0x1.8p+0 (;=-1.5;))))
+ (global $g1 (mut f32) (f32.const -0x1.8p+0 (;=-1.5;))))
;;; STDOUT ;;)