aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-11-27 09:19:15 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-11-27 09:19:15 -0800
commit9d20f0799c3eb4136e2048274bf523cb9a81ed1e (patch)
tree137680df47fc375f2311852ded7bac0f7f35fd0c
parent9c26a959a2dbd512e3c8f6aec04b59c25470dd39 (diff)
fix NUM_NAMED_GLOBALS bug with global postsets and add test coverage
-rw-r--r--src/jsifier.js2
-rwxr-xr-xtests/runner.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index ac8037df..d62fa788 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -319,7 +319,7 @@ function JSify(data, functionsOnly, givenFunctions) {
if (needsPostSet(value)) { // ident, or expression containing an ident
ret.push({
intertype: 'GlobalVariablePostSet',
- JS: makeSetValue(item.ident, i, value, 'i32', false, true) + ';' // ignore=true, since e.g. rtti and statics cause lots of safe_heap errors
+ JS: makeSetValue(makeGlobalUse(item.ident), i, value, 'i32', false, true) + ';' // ignore=true, since e.g. rtti and statics cause lots of safe_heap errors
});
constant[i] = '0';
}
diff --git a/tests/runner.py b/tests/runner.py
index 6c4be115..1beef857 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -5956,7 +5956,7 @@ void*:16
self.do_run(path_from_root('tests', 'cubescript'), '*\nTemp is 33\n9\n5\nhello, everyone\n*', main_file='command.cpp')
def test_gcc_unmangler(self):
- #Settings.NUM_NAMED_GLOBALS = 0 # test coverage for this
+ Settings.NUM_NAMED_GLOBALS = 0 # test coverage for this
Building.COMPILER_TEST_OPTS = ['-I' + path_from_root('third_party')]