From f3209584a3ae22afc84f2bde6899e248bc86a154 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Wed, 12 Oct 2016 17:51:36 +0100 Subject: Add Pointer Arithmetic --- src/checker/stmt.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/checker/stmt.cpp') diff --git a/src/checker/stmt.cpp b/src/checker/stmt.cpp index e4927345e..0b703edac 100644 --- a/src/checker/stmt.cpp +++ b/src/checker/stmt.cpp @@ -1007,14 +1007,16 @@ void check_stmt(Checker *c, AstNode *node, u32 flags) { Operand operand = {Addressing_Invalid}; AstNode binary_expr = {AstNode_BinaryExpr}; ast_node(be, BinaryExpr, &binary_expr); - be->op = op; + be->op = op; + be->op.kind = cast(TokenKind)(cast(i32)be->op.kind - (Token_AddEq - Token_Add)); // NOTE(bill): Only use the first one will be used be->left = as->lhs[0]; be->right = as->rhs[0]; check_binary_expr(c, &operand, &binary_expr); - if (operand.mode == Addressing_Invalid) + if (operand.mode == Addressing_Invalid) { return; + } // NOTE(bill): Only use the first one will be used check_assignment_variable(c, &operand, as->lhs[0]); } break; -- cgit v1.2.3