Compiler: Added some more consistency checks to the type checker.

parent 18aecc99
......@@ -124,7 +124,11 @@ void compiler_discard_top_type(void)
{
TYPE_STACK_DEBUG("discard_top_type");
#ifdef PIKE_DEBUG
if (!peek_stack_mark())
if (pike_type_mark_stack == Pike_compiler->pike_type_mark_stackp) {
/* Type mark stack empty. */
if (type_stack == Pike_compiler->type_stackp)
Pike_fatal("Type stack underflow.\n");
} else if (!peek_stack_mark())
Pike_fatal("Type stack underflow.\n");
#endif
free_type(*(Pike_compiler->type_stackp--));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment