Skip to content

Commit 8046a49

Browse files
authored
Fix bug in --reproduce with -ofoo.js flag (emscripten-core#23323)
The `-o` flag is not ever followed by an equals sign (`-o=out.js` will produce a file called `=out.js`) so this code was not handling the use case it was indented to.
1 parent 169c517 commit 8046a49

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

emcc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def make_relative(filename):
203203
if arg.startswith('--reproduce='):
204204
continue
205205

206-
if arg.startswith('-o='):
206+
if len(arg) > 2 and arg.startswith('-o'):
207207
rsp.write('-o\n')
208208
arg = arg[3:]
209209
output_arg = True

test/test_other.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14416,7 +14416,8 @@ def test_stack_overflow(self):
1441614416

1441714417
@crossplatform
1441814418
def test_reproduce(self):
14419-
self.run_process([EMCC, '-sASSERTIONS=1', '--reproduce=foo.tar', test_file('hello_world.c')])
14419+
ensure_dir('tmp')
14420+
self.run_process([EMCC, '-sASSERTIONS=1', '--reproduce=foo.tar', '-otmp/out.js', test_file('hello_world.c')])
1442014421
self.assertExists('foo.tar')
1442114422
names = []
1442214423
root = os.path.splitdrive(path_from_root())[1][1:]
@@ -14436,6 +14437,8 @@ def test_reproduce(self):
1443614437
self.assertTextDataIdentical(expected, names)
1443714438
expected = '''\
1443814439
-sASSERTIONS=1
14440+
-o
14441+
out.js
1443914442
<root>/test/hello_world.c
1444014443
'''
1444114444
response = read_file('foo/response.txt')

0 commit comments

Comments
 (0)