pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*   || 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: las.c,v 1.407 2008/05/01 20:41:43 mast Exp $ + || $Id: las.c,v 1.408 2008/05/15 15:13:04 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"
pike.git/src/las.c:4096:    }    free_type(array_zero);    }    }    }    foreach_type_check_done:    copy_pike_type(n->type, void_type_string);    break;       case F_SSCANF: -  if (!CAR(n) || (CAR(n)->token != F_ARG_LIST) || -  !CAAR(n) || !CDAR(n)) { +  if (!CAR(n) || (CAR(n)->token != ':') || +  !CDAR(n) || (CDAR(n)->token != F_ARG_LIST) || +  !CADAR(n) || !CDDAR(n)) {    yyerror("Too few arguments to sscanf().");    } else {    check_node_type(CAAR(n), string_type_string,    "Bad argument 1 to sscanf().");    check_node_type(CDAR(n), string_type_string,    "Bad argument 2 to sscanf().");    }    /* FIXME: */    MAKE_CONSTANT_TYPE(n->type, tIntPos);    break;
pike.git/src/las.c:4256: Inside #if defined(SHARED_NODES)
      case F_SSCANF:    {    int i;       /* catch_usage is restored if sscanf throws an error. */    for (i=0; i < MAX_LOCAL; i++) {    usage[i] |= catch_u[i];    }    /* Only the first two arguments are evaluated. */ -  if (CAR(n)) { -  find_usage(CDAR(n), usage, switch_u, cont_u, break_u, catch_u); -  find_usage(CAAR(n), usage, switch_u, cont_u, break_u, catch_u); +  if (CAR(n) && CDAR(n)) { +  find_usage(CDDAR(n), usage, switch_u, cont_u, break_u, catch_u); +  find_usage(CADAR(n), usage, switch_u, cont_u, break_u, catch_u);    }    return;    }       case F_CATCH:    {    unsigned char catch_usage[MAX_LOCAL];    int i;       MEMCPY(catch_usage, usage, MAX_LOCAL);
pike.git/src/las.c:4542: Inside #if defined(SHARED_NODES)
      case F_SSCANF:    {    int i;       /* catch_usage is restored if sscanf throws an error. */    for (i=0; i < MAX_LOCAL; i++) {    usage[i] |= catch_u[i];    }    /* Only the first two arguments are evaluated. */ -  if (CAR(n)) { -  cdr = low_localopt(CDAR(n), usage, switch_u, cont_u, break_u, catch_u); -  car = low_localopt(CAAR(n), usage, switch_u, cont_u, break_u, catch_u); +  if (CAR(n) && CDAR(n)) { +  cdr = low_localopt(CDDAR(n), usage, switch_u, cont_u, break_u, catch_u); +  car = low_localopt(CADAR(n), usage, switch_u, cont_u, break_u, catch_u);       if (CDR(n)) {    ADD_NODE_REF(CDR(n));    } -  return mknode(F_SSCANF, mknode(F_ARG_LIST, car, cdr), CDR(n)); +  return mknode(F_SSCANF, mknode(':', CAAR(n), +  mknode(F_ARG_LIST, car, cdr)), CDR(n));    }    ADD_NODE_REF(n);    return n;    }       case F_CATCH:    {    unsigned char catch_usage[MAX_LOCAL];    int i;