From 3fa398ec43ddc6fc40562087fd8ab87dc5292499 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Thu, 15 Jun 2017 21:36:29 +0100 Subject: Add extra check for bodiless procedures --- src/checker.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/checker.cpp') diff --git a/src/checker.cpp b/src/checker.cpp index 7fc849237..0f8c2606a 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1696,19 +1696,14 @@ void check_collect_entities(Checker *c, Array nodes, bool is_file_sco case_ast_node(fb, ForeignBlockDecl, decl); AstNode *foreign_library = fb->foreign_library; - bool ok = true; if (foreign_library->kind != AstNode_Ident) { error_node(foreign_library, "foreign library name must be an identifier"); - ok = false; + foreign_library = NULL; } CheckerContext prev_context = c->context; - if (ok) { - c->context.curr_foreign_library = foreign_library; - } - + c->context.curr_foreign_library = foreign_library; check_collect_entities(c, fb->decls, is_file_scope); - c->context = prev_context; case_end; -- cgit v1.2.3