diff options
-rw-r--r-- | src/binary-reader.cc | 4 | ||||
-rw-r--r-- | test/binary/bad-import-kind.txt | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/binary-reader.cc b/src/binary-reader.cc index 7f195356..217253f5 100644 --- a/src/binary-reader.cc +++ b/src/binary-reader.cc @@ -2086,6 +2086,10 @@ Result BinaryReader::ReadImportSection(Offset section_size) { num_event_imports_++; break; } + + default: + PrintError("malformed import kind: %d", kind); + return Result::Error; } } diff --git a/test/binary/bad-import-kind.txt b/test/binary/bad-import-kind.txt new file mode 100644 index 00000000..3c850880 --- /dev/null +++ b/test/binary/bad-import-kind.txt @@ -0,0 +1,8 @@ +;;; TOOL: run-gen-wasm-bad +magic +version +section(IMPORT) { count[1] str("module") str("func") dummy[5] } +(;; STDERR ;;; +0000018: error: malformed import kind: 5 +0000018: error: malformed import kind: 5 +;;; STDERR ;;) |