From 8364f509e31c187351bbc193a351aad90480c725 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 2 Dec 2017 18:52:05 +0100 Subject: Fix error handling for nested always/initial --- frontends/ast/simplify.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'frontends/ast/simplify.cc') diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 74e7b4675..f61f7cf7c 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -401,6 +401,9 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, if (type == AST_ALWAYS || type == AST_INITIAL) { + if (current_always != nullptr) + log_error("Invalid nesting of always blocks and/or initializations at %s:%d.\n", filename.c_str(), linenum); + current_always = this; current_always_clocked = false; -- cgit v1.2.3