diff options
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r-- | src/wasm-binary.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index cc98ebf8b..e03fd29ea 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -862,9 +862,7 @@ public: void readFunctionSignatures(); size_t nextLabel; - Name getNextLabel() { - return cashew::IString(("label$" + std::to_string(nextLabel++)).c_str(), false); - } + Name getNextLabel(); // We read functions before we know their names, so we need to backpatch the names later std::vector<Function*> functions; // we store functions here before wasm.addFunction after we know their names @@ -874,6 +872,9 @@ public: Function* currFunction = nullptr; Index endOfFunction = -1; // before we see a function (like global init expressions), there is no end of function to check + // Throws a parsing error if we are not in a function context + void requireFunctionContext(const char* error); + void readFunctions(); std::map<Export*, Index> exportIndexes; |