]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
cleanups and fixes that cppcheck found
[xonotic/gmqcc.git] / parser.c
index 128fa4f79c2d2210f47a1e88eb5fb95b2be97788..9955058360ad5d842fa91757e85955f5327a9c93 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1921,6 +1921,12 @@ static ast_expression* process_condition(parser_t *parser, ast_expression *cond,
             /* use the right NOT_ */
             prev = cond;
             cond = (ast_expression*)ast_unary_new(ast_ctx(cond), type_not_instr[cond->expression.vtype], cond);
+
+            /*
+             * cppcheck: it thinks there is a possible null pointer dereference
+             * otherwise it would be "redundant" to check it ast_unary_new returned
+             * null, it's wrong.
+             */   
             if (!cond) {
                 ast_unref(prev);
                 parseerror(parser, "internal error: failed to process condition");