Skip to content

Commit

Permalink
Fixing #176
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoeilers committed Mar 15, 2024
1 parent e0920e6 commit 9d8f182
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/nagini_translation/translators/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,16 +957,17 @@ def _inline_call(self, method: PythonMethod, node: ast.Call, is_super: bool,
if method in ctx.inlined_calls:
raise InvalidProgramException(node, 'recursive.static.call')
position = self.to_position(node, ctx)
old_position = ctx.position
ctx.position.append((inline_reason, position))
arg_stmts, arg_vals, arg_types = self._translate_call_args(node, ctx)
args = []
stmts = arg_stmts

# Create local vars for parameters and assign args to them
if is_super:
arg_vals = ([next(iter(ctx.actual_function.args.values())).ref()] +
arg_vals)
self_var_name = next(iter(ctx.actual_function.args.keys()))
self_var = (ctx.var_aliases[self_var_name] if self_var_name in ctx.var_aliases
else next(iter(ctx.actual_function.args.values())))
arg_vals = [self_var.ref()] + arg_vals
for arg_val, (_, arg) in zip(arg_vals, method.args.items()):
arg_var = ctx.current_function.create_variable('arg', arg.type,
self.translator)
Expand Down

0 comments on commit 9d8f182

Please sign in to comment.