diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-06-28 22:16:41 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-07-03 15:31:04 -0700 |
commit | dda4942ef82b68331ed20ed7ce2fb433d396e44c (patch) | |
tree | b7c7565256cf7e4cdb9b4ea969c664f10e699a98 /emlink.py | |
parent | 56d117e286cc19f13f8470204cc5a03f1772fb3b (diff) |
assert on no nesting in function table updates during linking
Diffstat (limited to 'emlink.py')
-rw-r--r-- | emlink.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -145,8 +145,10 @@ class AsmModule(): def update_fts(what): def fix(m): table = 'FUNCTION_TABLE_' + m.group(1) - return '%s[%s& %d]' % (table, m.group(2), f_sizes[table]-1) - return re.sub('FUNCTION_TABLE_(\w+)\[(.*)& (\d+)\]', fix, what) # XXX handle nested [, ] + contents = m.group(2) + assert '[' not in contents # TODO handle nesting + return '%s[%s&%d]' % (table, contents, f_sizes[table]-1) + return re.sub('FUNCTION_TABLE_(\w+)\[(.*)& ?(\d+)\]', fix, what) main.funcs_js = update_fts(main.funcs_js) main.extra_funcs_js = update_fts(main.extra_funcs_js) |