Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
StunxFS committed Jan 2, 2024
1 parent 073e6db commit 9c2ca89
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rivetc/src/codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,21 +1210,20 @@ def gen_expr(self, expr, custom_tmp = None):
left_sym = expr.sym.self_typ.symbol()
if left_sym.kind == TypeKind.DynArray:
expr.sym = self.comp.dyn_array_sym[expr.sym.name]
sym_rec_is_ref = expr.sym.self_is_ptr or expr.sym.self_is_boxed
receiver = expr.left.left
if left_sym.kind == TypeKind.Trait and expr.sym.self_typ != receiver.typ:
self_expr = self.gen_expr_with_cast(
expr.sym.self_typ, receiver
)
else:
self_expr = self.gen_expr(receiver)
if sym_rec_is_ref and not isinstance(
if expr.sym.self_is_ptr and not isinstance(
self_expr.typ, ir.Pointer
):
self_expr = ir.Inst(ir.InstKind.GetPtr, [self_expr])
elif isinstance(
receiver.typ, type.Ptr
) and not sym_rec_is_ref:
) and not expr.sym.self_is_ptr:
self_expr = ir.Inst(ir.InstKind.LoadPtr, [self_expr])
args.append(self_expr)
args_len = expr.sym.args_len()
Expand Down

0 comments on commit 9c2ca89

Please sign in to comment.