Skip to content

Commit 00794a5

Browse files
committed
Upgrade Binaryen to recent master
1 parent f34e0c3 commit 00794a5

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

cmake/ProjectBinaryen.cmake

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ set(binaryen_other_libraries
2929
${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}wasm${CMAKE_STATIC_LIBRARY_SUFFIX}
3030
${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}asmjs${CMAKE_STATIC_LIBRARY_SUFFIX}
3131
${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}passes${CMAKE_STATIC_LIBRARY_SUFFIX}
32+
${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}wasm${CMAKE_STATIC_LIBRARY_SUFFIX}
3233
${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}cfg${CMAKE_STATIC_LIBRARY_SUFFIX}
3334
${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}ir${CMAKE_STATIC_LIBRARY_SUFFIX}
3435
${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}emscripten-optimizer${CMAKE_STATIC_LIBRARY_SUFFIX}
@@ -37,12 +38,12 @@ set(binaryen_other_libraries
3738

3839
ExternalProject_Add(binaryen
3940
PREFIX ${prefix}
40-
DOWNLOAD_NAME binaryen-1.38.9.tar.gz
41+
DOWNLOAD_NAME binaryen-45714b5fc6cf14c112bc4f188aca427464ab69d8.tar.gz
4142
DOWNLOAD_DIR ${prefix}/downloads
4243
SOURCE_DIR ${source_dir}
4344
BINARY_DIR ${binary_dir}
44-
URL https://github.com/WebAssembly/binaryen/archive/1.38.9.tar.gz
45-
URL_HASH SHA256=f8c6d4deb83dba8709c4df9f7983080ec0f9412e88899767ed2815b911ce1ebd
45+
URL https://github.com/WebAssembly/binaryen/archive/45714b5fc6cf14c112bc4f188aca427464ab69d8.tar.gz
46+
URL_HASH SHA256=4b930c751b269ea989f503a624d1361f31d3c7366d4c6f4c005c7d50399e9a1f
4647
CMAKE_ARGS
4748
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
4849
-DCMAKE_INSTALL_LIBDIR=lib
@@ -63,7 +64,6 @@ set_target_properties(
6364
IMPORTED_LOCATION_RELEASE ${binaryen_library}
6465
INTERFACE_INCLUDE_DIRECTORIES ${binaryen_include_dir}
6566
INTERFACE_LINK_LIBRARIES "${binaryen_other_libraries}"
66-
6767
)
6868

6969
add_dependencies(binaryen::binaryen binaryen)

src/binaryen.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ class BinaryenEthereumInterface : public wasm::ShellExternalInterface, EthereumI
4949
{ }
5050

5151
protected:
52-
wasm::Literal callImport(wasm::Import *import, wasm::LiteralList& arguments) override;
52+
wasm::Literal callImport(wasm::Function* import, wasm::LiteralList& arguments) override;
5353
#if HERA_DEBUGGING
54-
wasm::Literal callDebugImport(wasm::Import *import, wasm::LiteralList& arguments);
54+
wasm::Literal callDebugImport(wasm::Function* import, wasm::LiteralList& arguments);
5555
#endif
5656

5757
void importGlobals(map<wasm::Name, wasm::Literal>& globals, wasm::Module& wasm) override;
@@ -73,7 +73,7 @@ class BinaryenEthereumInterface : public wasm::ShellExternalInterface, EthereumI
7373
}
7474

7575
#if HERA_DEBUGGING
76-
wasm::Literal BinaryenEthereumInterface::callDebugImport(wasm::Import *import, wasm::LiteralList& arguments) {
76+
wasm::Literal BinaryenEthereumInterface::callDebugImport(wasm::Function *import, wasm::LiteralList& arguments) {
7777
heraAssert(import->module == wasm::Name("debug"), "Import namespace error.");
7878

7979
if (import->base == wasm::Name("print32")) {
@@ -134,7 +134,7 @@ class BinaryenEthereumInterface : public wasm::ShellExternalInterface, EthereumI
134134
}
135135
#endif
136136

137-
wasm::Literal BinaryenEthereumInterface::callImport(wasm::Import *import, wasm::LiteralList& arguments) {
137+
wasm::Literal BinaryenEthereumInterface::callImport(wasm::Function* import, wasm::LiteralList& arguments) {
138138
#if HERA_DEBUGGING
139139
if (import->module == wasm::Name("debug"))
140140
// Reroute to debug namespace
@@ -622,7 +622,7 @@ void BinaryenEngine::verifyContract(wasm::Module & module)
622622
{ wasm::Name("selfDestruct"), createFunctionType({ wasm::Type::i32 }, wasm::Type::none) }
623623
};
624624

625-
for (auto const& import: module.imports) {
625+
for (auto const& import: module.functions) {
626626
ensureCondition(
627627
import->module == wasm::Name("ethereum")
628628
#if HERA_DEBUGGING
@@ -644,7 +644,7 @@ void BinaryenEngine::verifyContract(wasm::Module & module)
644644
"Importing invalid EEI method."
645645
);
646646

647-
wasm::FunctionType* function_type = module.getFunctionTypeOrNull(import->functionType);
647+
wasm::FunctionType* function_type = module.getFunctionTypeOrNull(import->type);
648648
ensureCondition(
649649
function_type,
650650
ContractValidationFailure,

src/shell-interface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface {
116116
trap("No globals supported.");
117117
}
118118

119-
Literal callImport(Import *import, LiteralList& arguments) override {
119+
Literal callImport(Function* import, LiteralList& arguments) override {
120120
(void)import;
121121
(void)arguments;
122122
trap("No imports supported.");

0 commit comments

Comments
 (0)