pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #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"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:2102:    free_string(s);    break;    }       case '?':    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    yyerror("Conditional expression is void.");    } 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;    }       if(CADR(n)->type == CDDR(n)->type)    {    copy_shared_string(n->type,CADR(n)->type);    return;    }
pike.git/src/las.c:2490: Inside #if defined(SHARED_NODES) && !defined(IN_TPIKE)
      if (!n)    return NULL;       switch(n->token) {    case F_ASSIGN:    if ((CDR(n)->token == F_LOCAL) && (!CDR(n)->u.integer.b)) {    /* 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);    } else if (CDR(n)->token == F_ARRAY_LVALUE) {    cdr = low_localopt(CDR(n), usage, switch_u, cont_u, break_u, catch_u);    } else {    cdr = CDR(n);    ADD_NODE_REF(cdr);    }    return mknode(F_ASSIGN, low_localopt(CAR(n), usage, switch_u, cont_u,