-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix validation edge case when function end code is missing
In some cases `m_resumeGenerateByteCodeAfterNBlockEnd` could be non-zero when the preprocessing is finished on invalid wasm code. Signed-off-by: Máté Tokodi [email protected]
- Loading branch information
1 parent
d94bad3
commit a5e762f
Showing
2 changed files
with
30 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(assert_invalid | ||
(module binary | ||
"\00asm" "\01\00\00\00" | ||
"\01\09" ;; import section | ||
"\02\60\00\00\60\01\7f\01\7f" ;; type section entry | ||
"\03\02" ;; function section | ||
"\01\00" ;; function section entry | ||
"\07\09" ;; export section | ||
"\01\05\6e\6f\65\6e\64\00\00" ;; export section entry (function 'noend') | ||
"\0a\18" ;; begin code section | ||
"\01\16\00" ;; begin function body | ||
"\02\40" ;; block | ||
"\03\40" ;; loop | ||
"\02\40" ;; block | ||
"\03\40" ;; loop | ||
"\0c\00" ;; br 0 | ||
"\02\01" ;; block type[1] | ||
"\0b" ;; end | ||
"\0c\00" ;; br 0 | ||
"\0b" ;; end | ||
"\00" ;; unreachable | ||
"\00" ;; unreachable | ||
"\00" ;; unreachable | ||
"\0b" ;; end | ||
"\0b" ;; end | ||
) | ||
"function body must end with END opcode" | ||
) |