pike.git
/
src
/
pike_types.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/pike_types.cmod:1327:
case '9': /* Marker. */ *(++Pike_compiler->type_stackp) = mk_type(type, NULL, NULL, PT_IS_MARKER); break; } TYPE_STACK_DEBUG("push_type"); } /* Pop one level of types. This is the inverse of push_type() */
-
void
debug_pop_type_stack(unsigned int expected)
+
int
debug_pop_type_stack(unsigned int expected)
{ struct pike_type *top; if(Pike_compiler->type_stackp<type_stack) Pike_fatal("Type stack underflow\n"); top = *(Pike_compiler->type_stackp); /* Special case... */
-
if (!top || top->type == T_MIXED)
return;
/* Probably due to an earlier error */
+
if (!top ||
(
top->type == T_MIXED)
||
+
((top == any_type_string) && (expected != T_OR))) {
+
/* Probably due to an earlier error */
+
return 0;
+
}
Pike_compiler->type_stackp--; #ifdef PIKE_DEBUG if ((top->type != expected) && (top->type != PIKE_T_NAME) && (top->type != PIKE_T_ATTRIBUTE)) { Pike_fatal("Unexpected type on stack: %d (expected %d)\n", top->type, expected); } #endif /* PIKE_DEBUG */ /* OPTIMIZE: It looks like this function is always called with
pike.git/src/pike_types.cmod:1399:
case '6': case '7': case '8': case '9': /* Leaf */ break; case PIKE_T_ATTRIBUTE: case PIKE_T_NAME: /* Pop the name and recurse. */ push_finished_type(top->cdr);
-
pop_type_stack(expected);
-
break;
+
return
pop_type_stack(expected);
case PIKE_T_OPERATOR: if (top->type & 0x8000) { push_finished_type(top->cdr); } push_finished_type(top->car); break; default: Pike_error("pop_type_stack(): Unhandled node type: %d\n", top->type); } free_type(top); TYPE_STACK_DEBUG("pop_type_stack");
-
+
+
return 1;
} void debug_push_reverse_type(unsigned int type) { /* fprintf(stderr, "push_reverse_type(%d)\n", type); */ switch(type & 0x80ff) { case T_FUNCTION: case T_MANY: case T_TUPLE: