Branch: Tag:

1999-11-24

1999-11-24 01:16:40 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Type-stack overflows nolonger stomp on innocent memory.
They will still cause length of type is wrong fatal errors though.

Rev: src/pike_types.h:1.27

5:   \*/      /* -  * $Id: pike_types.h,v 1.26 1999/11/23 22:34:35 grubba Exp $ +  * $Id: pike_types.h,v 1.27 1999/11/24 01:16:40 grubba Exp $    */   #ifndef PIKE_TYPES_H   #define PIKE_TYPES_H
91:   #define exit_type_stack pop_stack_mark   #endif    + /* Hmm, these will cause fatals if they fail... */   #define push_type(X) do { \ -  *type_stackp=(X); \ -  type_stackp++; \ +     if(type_stackp >= type_stack + sizeof(type_stack)) \    yyerror("Type stack overflow."); \ -  +  else { \ +  *type_stackp=(X); \ +  type_stackp++; \ +  } \   } while(0)         #define type_stack_mark() do { \ -  *pike_type_mark_stackp=type_stackp; \ -  pike_type_mark_stackp++; \ +     if(pike_type_mark_stackp >= pike_type_mark_stack + NELEM(pike_type_mark_stack)) \    yyerror("Type mark stack overflow."); \ -  +  else { \ +  *pike_type_mark_stackp=type_stackp; \ +  pike_type_mark_stackp++; \ +  } \   } while(0)      #define reset_type_stack() do { \