Skip to content

Commit 63ebdb6

Browse files
dcodeIOkripken
authored andcommitted
Also clear imports and exports maps in BinaryenModuleDispose (#1372)
fixes #1369 * Update binaries and kitchen-sink test
1 parent 3b1f2c4 commit 63ebdb6

File tree

5 files changed

+39
-37
lines changed

5 files changed

+39
-37
lines changed

bin/binaryen.js

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/wasm.js

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/binaryen-c.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ void BinaryenModuleDispose(BinaryenModuleRef module) {
180180
functionTypes.clear();
181181
expressions.clear();
182182
functions.clear();
183+
imports.clear();
184+
exports.clear();
183185
relooperBlocks.clear();
184186
}
185187

test/binaryen.js/kitchen-sink.js.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ getExpressionInfo(f64.const)={"id":15,"type":4,"value":9.5}
20332033
BinaryenType paramTypes[] = { 1 };
20342034
functionTypes[1] = BinaryenAddFunctionType(the_module, "vi", 0, paramTypes, 1);
20352035
}
2036-
imports[1] = BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]);
2036+
imports[0] = BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]);
20372037
the_relooper = RelooperCreate();
20382038
expressions[1] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
20392039
{

test/example/c-api-kitchen-sink.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,7 @@ int main() {
19881988
BinaryenType paramTypes[] = { 1 };
19891989
functionTypes[1] = BinaryenAddFunctionType(the_module, "vi", 0, paramTypes, 1);
19901990
}
1991-
imports[1] = BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]);
1991+
imports[0] = BinaryenAddFunctionImport(the_module, "check", "module", "check", functionTypes[1]);
19921992
the_relooper = RelooperCreate();
19931993
expressions[1] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
19941994
{

0 commit comments

Comments
 (0)