diff --git a/src/stab.cpp b/src/stab.cpp index 00190ccc..06385d18 100644 --- a/src/stab.cpp +++ b/src/stab.cpp @@ -96,6 +96,13 @@ Block::fn_body_enter() void Block::exit() { + if (scope_block.empty()) + /* + * @error + * A #pragma block_exit was performed without + * having a corresponding active block. + */ + Error::error(E_FATAL, "#pragma block_exit on an empty block stack"); scope_block.pop_back(); current_block--; param_clear();