2016-11-23 | Paul Boddie | raw files shortlog changelog graph | Produce a proper error when too many arguments are given for an invocation. | |
translator.py (file) |
1.1 --- a/translator.py Wed Nov 23 15:48:37 2016 +0100 1.2 +++ b/translator.py Wed Nov 23 16:19:06 2016 +0100 1.3 @@ -919,7 +919,11 @@ 1.4 encode_symbol("pcode", arg.name))) 1.5 1.6 else: 1.7 - args[i+1] = str(argexpr) 1.8 + try: 1.9 + args[i+1] = str(argexpr) 1.10 + except IndexError: 1.11 + raise TranslateError("Too many arguments specified.", 1.12 + self.get_namespace_path(), n) 1.13 1.14 # Reference the current target again. 1.15