summaryrefslogtreecommitdiff
path: root/com.c
diff options
context:
space:
mode:
Diffstat (limited to 'com.c')
-rw-r--r--com.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/com.c b/com.c
index 432ebb4..ca18c36 100644
--- a/com.c
+++ b/com.c
@@ -655,6 +655,8 @@ static void cpl_expr(Compiler *C, Val v, int flags) {
// so (returned values) = (stack change) - (new locals) = 1
CHECK( (stack_cur_b - stack_cur_a) - (nlocals_b - nlocals_a) == 1,
"stack corruption (compiler bug)");
+ CHECK( (flags & F_toplevel) || (nlocals_b == nlocals_a),
+ "local declared not at top level (compiler bug)");
}