aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-25 11:15:47 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-25 11:15:47 -0700
commita00ffce0b71a670b0d227562cfad649947b714a7 (patch)
tree57a8ff977f39e6dbb5a04c3a9196b7eddf8e655b
parentfac94229d8765d20aa00fdfcad1e7f940b5cb322 (diff)
clean up meminit detection
-rwxr-xr-xemcc7
1 files changed, 3 insertions, 4 deletions
diff --git a/emcc b/emcc
index fed7e997..fb77ae80 100755
--- a/emcc
+++ b/emcc
@@ -1510,10 +1510,9 @@ try:
if shared.Settings.USE_TYPED_ARRAYS != 2:
if type(memory_init_file) == int: print >> sys.stderr, 'emcc: warning: memory init file requires typed arrays mode 2'
else:
- memfile = target + '.mem'
- seen_memory_init = False
+ memfile = target + '.mem'
+ shared.try_delete(memfile)
def repl(m):
- seen_memory_init = True
# handle chunking of the memory initializer
s = re.sub('[\[\]\n\(\)\. ]', '', m.groups(0)[0])
s = s.replace('concat', ',')
@@ -1529,7 +1528,7 @@ try:
open(final + '.mem.js', 'w').write(src)
final += '.mem.js'
if DEBUG:
- if seen_memory_init:
+ if os.path.exists(memfile):
save_intermediate('meminit')
print >> sys.stderr, 'emcc: wrote memory initialization to %s' % memfile
else: