diff options
author | Heejin Ahn <aheejin@gmail.com> | 2021-06-19 23:06:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-19 23:06:27 -0700 |
commit | 9fc276298b36080658236f0bc93d94cdf774492c (patch) | |
tree | b60592556b9edf4bb2dcd40034cb760c504cf576 /src/wasm/wasm-s-parser.cpp | |
parent | aae35755e1d047c1f6fba9abfd2d836feafa5f66 (diff) | |
download | binaryen-9fc276298b36080658236f0bc93d94cdf774492c.tar.gz binaryen-9fc276298b36080658236f0bc93d94cdf774492c.tar.bz2 binaryen-9fc276298b36080658236f0bc93d94cdf774492c.zip |
Remove (attr 0) from tag text format (#3946)
This attribute is always 0 and reserved for future use. In Binayren's
unofficial text format we were writing this field as `(attr 0)`, but we
have recently come to the conclusion that this is not necessary.
Relevant discussion:
https://github.com/WebAssembly/exception-handling/pull/160#discussion_r653254680
Diffstat (limited to 'src/wasm/wasm-s-parser.cpp')
-rw-r--r-- | src/wasm/wasm-s-parser.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index c688630c3..8bedeab9f 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -3109,14 +3109,6 @@ void SExpressionWasmBuilder::parseImport(Element& s) { } } else if (kind == ExternalKind::Tag) { auto tag = make_unique<Tag>(); - if (j >= inner.size()) { - throw ParseException("tag does not have an attribute", s.line, s.col); - } - auto& attrElem = *inner[j++]; - if (!elementStartsWith(attrElem, ATTR) || attrElem.size() != 2) { - throw ParseException("invalid attribute", attrElem.line, attrElem.col); - } - tag->attribute = atoi(attrElem[1]->c_str()); j = parseTypeUse(inner, j, tag->sig); tag->setName(name, hasExplicitName); tag->module = module; @@ -3498,20 +3490,6 @@ void SExpressionWasmBuilder::parseTag(Element& s, bool preParseImport) { ex->kind = ExternalKind::Tag; } - // Parse attribute - if (i >= s.size()) { - throw ParseException("tag does not have an attribute", s.line, s.col); - } - auto& attrElem = *s[i++]; - if (!elementStartsWith(attrElem, ATTR) || attrElem.size() != 2) { - throw ParseException("invalid attribute", attrElem.line, attrElem.col); - } - if (!attrElem[1]->isStr()) { - throw ParseException( - "invalid attribute", attrElem[1]->line, attrElem[1]->col); - } - tag->attribute = atoi(attrElem[1]->c_str()); - // Parse typeuse i = parseTypeUse(s, i, tag->sig); |