Meta+LibWasm: Correctly parse the invokee name in toplevel invokes

This commit is contained in:
Ali Mohammad Pur 2021-07-06 13:00:24 +04:30 committed by Ali Mohammad Pur
parent 0b08392e54
commit f5d4e26ff7
Notes: sideshowbarker 2024-07-18 10:18:32 +09:00

View File

@ -188,8 +188,10 @@ def generate(ast):
elif len(entry) >= 2 and entry[0][0] == 'invoke':
# toplevel invoke :shrug:
arg, name, module = 0, None, None
if isinstance(entry[1][1], str):
if not isinstance(entry[1], str) and isinstance(entry[1][1], str):
name = entry[1][1]
elif isinstance(entry[1], str):
name = entry[1]
else:
name = entry[1][2]
module = named_modules[entry[1][1][0]]