diff options
author | Dan Gohman <sunfish@mozilla.com> | 2016-01-11 15:42:48 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@mozilla.com> | 2016-01-11 15:42:48 -0800 |
commit | 91becc1a6cfa3c57eb6d2cb5f3c42f312d65f8b2 (patch) | |
tree | 07721f3ab0c1d83556345c88e986da394a031015 /src | |
parent | 4e98f922cb2d727a319f62d32e51afabb2e46d24 (diff) | |
parent | 20f01a9f8277111b69f3d916ec2e066f1f996c7d (diff) | |
download | binaryen-91becc1a6cfa3c57eb6d2cb5f3c42f312d65f8b2.tar.gz binaryen-91becc1a6cfa3c57eb6d2cb5f3c42f312d65f8b2.tar.bz2 binaryen-91becc1a6cfa3c57eb6d2cb5f3c42f312d65f8b2.zip |
Merge pull request #92 from WebAssembly/at-function
Update tests for upstream changes.
Diffstat (limited to 'src')
-rw-r--r-- | src/s2wasm.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index a0ecfd710..b99a71159 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -200,7 +200,7 @@ private: return false; } else { // a global constant, we need to fix it up later - Name name = getStrToSep(); + Name name = cleanFunction(getStrToSep()); int offset = 0; if (*s == '+') { s++; @@ -316,6 +316,16 @@ private: abort_on("getType"); } + // The LLVM backend emits function names as name@FUNCTION. We can drop the @ and after it. + Name cleanFunction(Name name) { + if (!strchr(name.str, '@')) return name; + char *temp = strdup(name.str); + *strchr(temp, '@') = 0; + Name ret = cashew::IString(temp, false); + free(temp); + return ret; + } + // processors void scan() { @@ -577,7 +587,7 @@ private: curr = specific; } else { assign = getAssign(); - Name target = getCommaSeparated(); + Name target = cleanFunction(getCommaSeparated()); if (implementedFunctions.count(target) > 0) { auto specific = allocator.alloc<Call>(); specific->target = target; |