From 9c2ca8951d32164c7d9fbd61bd244cbe8073ad31 Mon Sep 17 00:00:00 2001 From: StunxFS Date: Tue, 2 Jan 2024 09:38:20 -0400 Subject: [PATCH] cleanup --- rivetc/src/codegen/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rivetc/src/codegen/__init__.py b/rivetc/src/codegen/__init__.py index cfd5fb9bd..fe65948e3 100644 --- a/rivetc/src/codegen/__init__.py +++ b/rivetc/src/codegen/__init__.py @@ -1210,7 +1210,6 @@ 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( @@ -1218,13 +1217,13 @@ def gen_expr(self, expr, custom_tmp = None): ) 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()