diff options
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r-- | src/wasm-validator.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h index ffdd2a2b7..77bf6d3e9 100644 --- a/src/wasm-validator.h +++ b/src/wasm-validator.h @@ -367,14 +367,16 @@ public: std::set<Name> exportNames; for (auto& exp : curr->exports) { Name name = exp->value; - bool found = false; - for (auto& func : curr->functions) { - if (func->name == name) { - found = true; - break; + if (exp->kind == Export::Function) { + bool found = false; + for (auto& func : curr->functions) { + if (func->name == name) { + found = true; + break; + } } + shouldBeTrue(found, name, "module exports must be found"); } - shouldBeTrue(found, name, "module exports must be found"); Name exportName = exp->name; shouldBeFalse(exportNames.count(exportName) > 0, exportName, "module exports must be unique"); exportNames.insert(exportName); |