diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-01 21:57:47 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-01 21:57:47 -0500 |
commit | 86c668e53bfd657b6164b9821fc58ba23c23cebc (patch) | |
tree | 7f739ae27b00bd39c3a483f275a0052d3778224c | |
parent | c022f1839b955129527085f13e74805febf0fa66 (diff) |
assert on emscript child processes returning forwarded data, if not, they may have aborted prematurely
-rwxr-xr-x | emscripten.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py index 1db09a80..8bd1b58a 100755 --- a/emscripten.py +++ b/emscripten.py @@ -242,6 +242,8 @@ def emscript(infile, settings, outfile, libraries=[]): if jcache: outputs += cached_outputs # TODO: preserve order outputs = [output.split('//FORWARDED_DATA:') for output in outputs] + for output in outputs: + assert len(output) == 2, 'Did not receive forwarded data in an output - process failed? We only got: ' + output[1] if DEBUG: print >> sys.stderr, ' emscript: phase 2 took %s seconds' % (time.time() - t) if DEBUG: t = time.time() @@ -310,7 +312,7 @@ def emscript(infile, settings, outfile, libraries=[]): post_file = temp_files.get('.post.ll').name open(post_file, 'w').write('\n') # no input, just processing of forwarded data out = shared.run_js(compiler, shared.COMPILER_ENGINE, [settings_file, post_file, 'post', forwarded_file] + libraries, stdout=subprocess.PIPE, cwd=path_from_root('src')) - post, last_forwarded_data = out.split('//FORWARDED_DATA:') + post, last_forwarded_data = out.split('//FORWARDED_DATA:') # if this fails, perhaps the process failed prior to printing forwarded data? last_forwarded_json = json.loads(last_forwarded_data) if settings.get('ASM_JS'): |