Branch: Tag:

1999-11-19

1999-11-19 17:00:13 by Henrik Grubbström (Grubba) <grubba@grubba.org>

More paranoia in fix_type_field().

Rev: src/las.c:1.116

5:   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.115 1999/11/18 22:17:46 grubba Exp $"); + RCSID("$Id: las.c,v 1.116 1999/11/19 17:00:13 grubba Exp $");      #include "language.h"   #include "interpret.h"
2109:    } else if(!match_types(CAR(n)->type,mixed_type_string))    yyerror("Bad conditional expression.");    -  if(!CADR(n) || !CDDR(n)) +  if(!CDR(n) || !CADR(n) || !CDDR(n))    {    copy_shared_string(n->type,void_type_string);    return;
2497: Inside #if defined(SHARED_NODES) && !defined(IN_TPIKE)
   /* Assignment of local variable */    if (!(usage[CDR(n)->u.integer.a] & 1)) {    /* Value isn't used. */ -  return low_localopt(CAR(n), usage, switch_u, cont_u, break_u, catch_u); +  struct pike_string *ref_type; +  MAKE_CONSTANT_SHARED_STRING(ref_type, tOr(tComplex, tString)); +  if (!match_types(CDR(n)->type, ref_type)) { +  /* The variable doesn't hold a refcounted value. */ +  free_string(ref_type); +  return low_localopt(CAR(n), usage, switch_u, cont_u, +  break_u, catch_u);    } -  +  free_string(ref_type); +  }    usage[CDR(n)->u.integer.a] = 0;    cdr = CDR(n);    ADD_NODE_REF(cdr);