Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/core/binary.wast
Original file line number Diff line number Diff line change
Expand Up @@ -1208,3 +1208,25 @@
"unexpected content after last section"
)

;; The byte 0xff is documented as being a value that will not be used as
;; an instruction or instruction prefix opcode. Test that implementations
;; reject it. This test uses unreachable code in order to avoid
;; type-checking errors that might arise if 0xff were interpreted as an
;; instruction.
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section: 1 type
"\03\02\01\00" ;; Function section: 1 function
"\0a\08\01" ;; Code section: 1 function
;; function 0
"\06\00" ;; Function size and local type count
"\00" ;; unreachable
"\ff" ;; 0xff
"\00" ;; might be interpreted as unreachable, or as the second byte
;; of a multi-byte instruction
"\00" ;; unreachable
"\0b" ;; end
)
"illegal opcode ff"
)