Skip to content

Commit

Permalink
Fix source maps issues on windows; followup to #9882
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Nov 29, 2019
1 parent d016245 commit c78b2a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -9723,17 +9723,17 @@ def test_lsan_leaks(self, ext):
@parameterized({
'c': ['c', [
r'in malloc.*a\.out\.wasm\+0x',
r'(?im)in f (|[/a-z\.]:).*/test_lsan_leaks\.c:6:21$',
r'(?im)in main (|[/a-z\.]:).*/test_lsan_leaks\.c:10:16$',
r'(?im)in main (|[/a-z\.]:).*/test_lsan_leaks\.c:12:3$',
r'(?im)in main (|[/a-z\.]:).*/test_lsan_leaks\.c:13:3$',
r'(?im)in f (|[/a-z\.\\]:).*test_lsan_leaks\.c:6:21$',
r'(?im)in main (|[/a-z\.\\]:).*test_lsan_leaks\.c:10:16$',
r'(?im)in main (|[/a-z\.\\]:).*test_lsan_leaks\.c:12:3$',
r'(?im)in main (|[/a-z\.\\]:).*test_lsan_leaks\.c:13:3$',
]],
'cpp': ['cpp', [
r'in operator new\[\]\(unsigned long\).*a\.out\.wasm\+0x',
r'(?im)in f\(\) (|[/a-z\.]:).*/test_lsan_leaks\.cpp:4:21$',
r'(?im)in main (|[/a-z\.]:).*/test_lsan_leaks\.cpp:8:16$',
r'(?im)in main (|[/a-z\.]:).*/test_lsan_leaks\.cpp:10:3$',
r'(?im)in main (|[/a-z\.]:).*/test_lsan_leaks\.cpp:11:3$',
r'(?im)in f\(\) (|[/a-z\.\\]:).*test_lsan_leaks\.cpp:4:21$',
r'(?im)in main (|[/a-z\.\\]:).*test_lsan_leaks\.cpp:8:16$',
r'(?im)in main (|[/a-z\.\\]:).*test_lsan_leaks\.cpp:10:3$',
r'(?im)in main (|[/a-z\.\\]:).*test_lsan_leaks\.cpp:11:3$',
]],
})
@no_fastcomp('lsan not supported on fastcomp')
Expand Down
3 changes: 2 additions & 1 deletion tools/wasm-sourcemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def resolve(self, name):
if name in self.cache:
return self.cache[name]

result = name.replace('\\', '/').replace('//', '/')
for p in self.prefixes:
if name.startswith(p['prefix']):
if p['replacement'] is None:
Expand Down Expand Up @@ -270,6 +269,8 @@ def build_sourcemap(entries, code_section_offset, prefixes, collect_sources, bas
column = 1
address = entry['address'] + code_section_offset
file_name = entry['file']
# normalize between OSes
file_name = file_name.replace('\\', '/').replace('//', '/')
# if prefixes were provided, we use that; otherwise, we emit a relative
# path
if prefixes.provided():
Expand Down

0 comments on commit c78b2a8

Please sign in to comment.