Skip to content

Commit 43b5744

Browse files
committed
Bugfix: Do proper validation of the module
Also make sure invalid_retcount.wasm test is properly formatted so parser doesn't crash.
1 parent 79e6081 commit 43b5744

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/sectionvalidation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ def section_validation_fail(directory):
3434
module = interpreter.parse(testfile)
3535
interpreter.appendmodule(module)
3636
interpreter.dump_sections(module)
37+
modulevalidation = ModuleValidation(module)
3738
if "type" in directory:
38-
if not interpreter.TypeSection():
39+
if not modulevalidation.TypeSection():
3940
sys.exit(1)
4041
if "global" in directory:
41-
if not interpreter.GlobalSection():
42+
if not modulevalidation.GlobalSection():
4243
sys.exit(1)
4344
sys.exit()
4445
# the parent process
@@ -73,7 +74,8 @@ def section_validation():
7374
module = interpreter.parse(testfile)
7475
interpreter.appendmodule(module)
7576
interpreter.dump_sections(module)
76-
interpreter.runValidations()
77+
if not interpreter.runValidations():
78+
sys.exit(1)
7779
vm = VM(interpreter.getmodules())
7880
ms = vm.getState()
7981
# interpreter.dump_sections(module)
-1 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)