From: Brendan Hansen Date: Mon, 19 Apr 2021 17:51:37 +0000 (-0500) Subject: fixed bug with overloaded operators not discarding ignored return values X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=74f9749dc5d970e44de94ccc183081bf51b535eb;p=onyx.git fixed bug with overloaded operators not discarding ignored return values --- diff --git a/bin/onyx b/bin/onyx index c7d579b5..084335c7 100755 Binary files a/bin/onyx and b/bin/onyx differ diff --git a/src/onyxchecker.c b/src/onyxchecker.c index 7e5bdaf4..3a401869 100644 --- a/src/onyxchecker.c +++ b/src/onyxchecker.c @@ -1464,8 +1464,9 @@ CheckStatus check_statement(AstNode** pstmt) { case Ast_Kind_Defer: return check_statement(&((AstDefer *) stmt)->stmt); case Ast_Kind_Binary_Op: - stmt->flags |= Ast_Flag_Expr_Ignored; - return check_binaryop((AstBinaryOp **) pstmt, 1); + CHECK(binaryop, (AstBinaryOp **) pstmt, 1); + (*pstmt)->flags |= Ast_Flag_Expr_Ignored; + return Check_Success; // NOTE: Local variable declarations used to be removed after the symbol // resolution phase because long long ago, all locals needed to be known @@ -1475,8 +1476,9 @@ CheckStatus check_statement(AstNode** pstmt) { case Ast_Kind_Local: return Check_Success; default: - stmt->flags |= Ast_Flag_Expr_Ignored; - return check_expression((AstTyped **) pstmt); + CHECK(expression, (AstTyped **) pstmt); + (*pstmt)->flags |= Ast_Flag_Expr_Ignored; + return Check_Success; } }