Skip to content

Commit

Permalink
fix: ArrrayAccess loading array operand
Browse files Browse the repository at this point in the history
  • Loading branch information
G0nzal0zz committed Jan 16, 2025
1 parent d731c62 commit c49a94b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Codegen/ExprGen/DataValue.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ generateArrayAccess :: (CS.MonadCodegen m, ExprGen AT.Expr) => AT.Expr -> m AST.
generateArrayAccess (AT.ArrayAccess _ arrayExpr indexExpr) = do
arrayOperand <- generateExpr arrayExpr
indexOperand <- generateExpr indexExpr
I.gep arrayOperand [indexOperand]
ptr <- I.gep arrayOperand [indexOperand]
I.load ptr 0
generateArrayAccess expr =
E.throwError $ CC.CodegenError (SU.getLoc expr) $ CC.UnsupportedDefinition expr

Expand Down

0 comments on commit c49a94b

Please # to comment.