summaryrefslogtreecommitdiff
path: root/src/s2wasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/s2wasm.h')
-rw-r--r--src/s2wasm.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index c85a214a1..c2e8c77a0 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -405,9 +405,10 @@ class S2WasmBuilder {
void scan() {
while (*s) {
- s = strstr(s, "\n .type ");
+ skipWhitespace();
+ s = strstr(s, ".type");
if (!s) break;
- mustMatch("\n .type ");
+ mustMatch(".type");
Name name = getCommaSeparated();
skipComma();
if (!match("@function")) continue;
@@ -1282,6 +1283,8 @@ class S2WasmBuilder {
if (debug) std::cerr << " ==> " << *(relocation.data) << '\n';
} else {
// must be a function address
+ auto aliased = aliasedFunctions.find(name);
+ if (aliased != aliasedFunctions.end()) name = aliased->second;
if (!wasm.checkFunction(name)) {
std::cerr << "Unknown symbol: " << name << '\n';
if (!ignoreUnknownSymbols) abort();