Browse Source

Fix file scope #assert

gingerBill 7 years ago
parent
commit
d56f458d11
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/checker.cpp

+ 7 - 4
src/checker.cpp

@@ -2816,10 +2816,13 @@ bool collect_file_decls(CheckerContext *ctx, Array<Ast *> const &decls) {
 			}
 		case_end;
 
-		case_ast_node(ce, CallExpr, decl);
-			if (ce->proc->kind == Ast_BasicDirective) {
-				Operand o = {};
-				check_expr(ctx, &o, decl);
+		case_ast_node(es, ExprStmt, decl);
+			if (es->expr->kind == Ast_CallExpr) {
+				ast_node(ce, CallExpr, es->expr);
+				if (ce->proc->kind == Ast_BasicDirective) {
+					Operand o = {};
+					check_expr(ctx, &o, es->expr);
+				}
 			}
 		case_end;
 		}