aboutsummaryrefslogtreecommitdiff
path: root/emlink.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-28 22:16:41 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:04 -0700
commitdda4942ef82b68331ed20ed7ce2fb433d396e44c (patch)
treeb7c7565256cf7e4cdb9b4ea969c664f10e699a98 /emlink.py
parent56d117e286cc19f13f8470204cc5a03f1772fb3b (diff)
assert on no nesting in function table updates during linking
Diffstat (limited to 'emlink.py')
-rw-r--r--emlink.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/emlink.py b/emlink.py
index 38207d6a..229ea907 100644
--- a/emlink.py
+++ b/emlink.py
@@ -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)