From 5bbcaa3df570328e568131d8d65aaeb5581942a3 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 9 Jun 2014 15:18:28 -0700 Subject: do not modify textual memory initializer when emitting source maps, as it messes up line numbers; fixes #2410 --- emcc | 2 +- tests/test_core.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/emcc b/emcc index 0dfa5d86..20f04dd1 100755 --- a/emcc +++ b/emcc @@ -1694,7 +1694,7 @@ try: logging.debug('wrote memory initialization to %s', memfile) else: logging.debug('did not see memory initialization') - elif shared.Settings.USE_TYPED_ARRAYS == 2 and not shared.Settings.MAIN_MODULE and not shared.Settings.SIDE_MODULE: + elif shared.Settings.USE_TYPED_ARRAYS == 2 and not shared.Settings.MAIN_MODULE and not shared.Settings.SIDE_MODULE and debug_level < 4: # not writing a binary init, but we can at least optimize them by splitting them up src = open(final).read() src = shared.JS.optimize_initializer(src) diff --git a/tests/test_core.py b/tests/test_core.py index b9057f4e..0ec0320e 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -6386,10 +6386,15 @@ def process(filename): if (i < 10) throw i; // line 5 } + #include + #include + int main() { + std::string x = "ok"; // add libc++ stuff to make this big, test for #2410 int i; scanf("%d", &i); foo(i); + std::cout << x << std::endl; return 0; } ''' -- cgit v1.2.3-18-g5258