Skip to content

Commit d9338f7

Browse files
authored
wast-parser.cc: disallow exception tag unless exceptions enabled (#2110)
1 parent 9121857 commit d9338f7

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/wast-parser.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,10 @@ Result WastParser::ParseElemModuleField(Module* module) {
13461346

13471347
Result WastParser::ParseTagModuleField(Module* module) {
13481348
WABT_TRACE(ParseTagModuleField);
1349+
if (!options_->features.exceptions_enabled()) {
1350+
Error(Consume().loc, "tag not allowed");
1351+
return Result::Error;
1352+
}
13491353
EXPECT(Lpar);
13501354
EXPECT(Tag);
13511355
std::string name;

test/dump/tag.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
;;; TOOL: run-objdump
2-
;;; ARGS0: -v
2+
;;; ARGS0: -v --enable-exceptions
33
;;; ARGS1: -x
44
(module
55
(tag)

test/regress/regress-2110.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
;;; TOOL: wat2wasm
2+
;;; ERROR: 1
3+
(module
4+
(tag $e0 (param i32))
5+
)
6+
7+
(;; STDERR ;;;
8+
out/test/regress/regress-2110.txt:4:3: error: tag not allowed
9+
(tag $e0 (param i32))
10+
^
11+
;;; STDERR ;;)

0 commit comments

Comments
 (0)