Branch: Tag:

2008-06-16

2008-06-16 22:16:53 by Martin Stjernholm <mast@lysator.liu.se>

Streamlined discarding of types on the type stack somewhat.

Rev: src/language.yacc:1.431
Rev: src/pike_types.c:1.339
Rev: src/pike_types.h:1.119

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pike_types.c,v 1.338 2008/05/24 21:45:10 grubba Exp $ + || $Id: pike_types.c,v 1.339 2008/06/16 22:16:53 mast Exp $   */      #include "global.h"
139:    }   }    + void compiler_discard_type (void) + { +  ptrdiff_t len = pop_stack_mark(); +  TYPE_STACK_DEBUG("paranoid_pop_type"); +  for (;len > 0; len--) { +  /* Get rid of excess junk. */ +  free_type(*(Pike_compiler->type_stackp--)); +  } + } +    struct pike_type *debug_pop_type(void)   {    struct pike_type *t = pop_unfinished_type();
152:    TYPE_STACK_DEBUG("compiler_pop_type");    if(Pike_compiler->num_parse_error)    { -  ptrdiff_t len = pop_stack_mark(); +     struct pike_type *res; -  -  TYPE_STACK_DEBUG("paranoid_pop_type"); -  if (len > 0) { -  for (;len > 1; len--) { -  /* Get rid of excess junk. */ -  free_type(*(Pike_compiler->type_stackp--)); -  } -  res = *(Pike_compiler->type_stackp--); -  } else { +  compiler_discard_type();    add_ref(res = mixed_type_string); -  } +     type_stack_mark();    return res;    }else{