diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-03-29 20:37:49 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-03-29 20:39:14 -0700 |
commit | 4e71858950c4d1bb7ddfac871e72e5802c2e8362 (patch) | |
tree | c349cb140eee25e911033adcc9a2baa73a066155 /src | |
parent | 1604b4b7e265095c7d7d22455312684ee8dc0790 (diff) | |
download | binaryen-4e71858950c4d1bb7ddfac871e72e5802c2e8362.tar.gz binaryen-4e71858950c4d1bb7ddfac871e72e5802c2e8362.tar.bz2 binaryen-4e71858950c4d1bb7ddfac871e72e5802c2e8362.zip |
use ensureFunctionType in s2wasm, to ensure consistent function type names
Diffstat (limited to 'src')
-rw-r--r-- | src/s2wasm.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index f4c83fe65..07262d012 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -752,16 +752,7 @@ class S2WasmBuilder { indirect->operands.push_back(inputs[i]); } setOutput(indirect, assign); - auto typeName = cashew::IString((std::string("FUNCSIG_") + getSig(indirect)).c_str(), false); - if (wasm.functionTypesMap.count(typeName) == 0) { - auto type = allocator.alloc<FunctionType>(); - *type = sigToFunctionType(getSig(indirect)); - type->name = typeName; - wasm.addFunctionType(type); - indirect->fullType = type; - } else { - indirect->fullType = wasm.functionTypesMap[typeName]; - } + indirect->fullType = wasm.functionTypesMap[ensureFunctionType(getSig(indirect), &wasm, allocator)->name]; } else { // non-indirect call CallBase* curr; |