From dda4942ef82b68331ed20ed7ce2fb433d396e44c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 28 Jun 2013 22:16:41 -0700 Subject: assert on no nesting in function table updates during linking --- emlink.py | 6 ++++-- 1 file 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) -- cgit v1.2.3-18-g5258