pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.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.   \*/   /**/   #include "global.h" - RCSID("$Id: docode.c,v 1.142 2002/05/31 22:41:23 nilsson Exp $"); + RCSID("$Id: docode.c,v 1.143 2002/07/02 18:12:16 grubba Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"   #include "stralloc.h"   #include "interpret.h"   #include "constants.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"
pike.git/src/docode.c:469:   {    INT32 tmp1;    struct pike_string *n1=make_shared_string(func);    node *n=find_module_identifier(n1,0);    free_string(n1);       switch(n?n->token:0)    {    case F_CONSTANT:    tmp1=store_constant(&n->u.sval, -  n->tree_info & OPT_EXTERNAL_DEPEND, +  !(n->tree_info & OPT_EXTERNAL_DEPEND),    n->name);    if(n->u.sval.type == T_FUNCTION &&    n->u.sval.subtype == FUNCTION_BUILTIN)    emit1(F_CALL_BUILTIN, DO_NOT_WARN((INT32)tmp1));    else    emit1(F_APPLY, DO_NOT_WARN((INT32)tmp1));    break;       default:    my_yyerror("docode: Failed to make call to %s",func);
pike.git/src/docode.c:532:   {    INT32 tmp1;    struct pike_string *n1=make_shared_string(func);    node *n=find_module_identifier(n1,0);    free_string(n1);       switch(n?n->token:0)    {    case F_CONSTANT:    tmp1=store_constant(&n->u.sval, -  n->tree_info & OPT_EXTERNAL_DEPEND, +  (!(n->tree_info & OPT_EXTERNAL_DEPEND)) && +  (n->u.sval.type != T_TYPE),    n->name);    emit1(F_CONSTANT, DO_NOT_WARN((INT32)tmp1));    break;       default:    my_yyerror("docode: Failed to make svalue for builtin %s",func);    }    free_node(n);   }   
pike.git/src/docode.c:1362:    emit0(F_CONST0);    else if(tmp1>1)    do_pop(DO_NOT_WARN((INT32)(tmp1-1)));    return 1;    }    {    struct svalue sv;    sv.type = T_TYPE;    sv.subtype = 0;    sv.u.type = n->type; -  tmp1 = store_constant(&sv, 1, n->name); +  tmp1 = store_constant(&sv, 0, n->name);    emit1(F_CONSTANT, DO_NOT_WARN((INT32)tmp1));    }       tmp1=do_docode(CAR(n),0);    if(!tmp1) { emit0(F_CONST0); tmp1=1; }    if(tmp1>1) do_pop(DO_NOT_WARN((INT32)(tmp1-1)));       emit0(F_CAST);    return 1;       case F_SOFT_CAST:    if (runtime_options & RUNTIME_CHECK_TYPES) {    {    struct svalue sv;    sv.type = T_TYPE;    sv.subtype = 0;    sv.u.type = n->type; -  tmp1 = store_constant(&sv, 1, n->name); +  tmp1 = store_constant(&sv, 0, n->name);    emit1(F_CONSTANT, DO_NOT_WARN((INT32)tmp1));    }    tmp1 = do_docode(CAR(n), 0);    if (!tmp1) { emit0(F_CONST0); tmp1 = 1; }    if (tmp1 > 1) do_pop(DO_NOT_WARN((INT32)(tmp1 - 1)));    emit0(F_SOFT_CAST);    return 1;    }    tmp1 = do_docode(CAR(n), flags);    if (tmp1 > 1) do_pop(DO_NOT_WARN((INT32)(tmp1 - 1)));
pike.git/src/docode.c:2022:    struct program_state *state=Pike_compiler;    for(;state->fake_object!=n->u.sval.u.object;state=state->previous)    x++;   #endif    emit2(F_EXTERNAL, n->u.sval.subtype, x);    Pike_compiler->new_program->flags |=    PROGRAM_USES_PARENT | PROGRAM_NEEDS_PARENT;    return 1;    }    } -  +  /* FALL_THROUGH */   #ifdef PIKE_DEBUG    case T_OBJECT:    if(n->u.sval.u.object->next == n->u.sval.u.object)    fatal("Internal error: Pointer to parent cannot be a compile time constant!\n");   #endif -  +  /* FALL_THROUGH */    default:    tmp1=store_constant(&(n->u.sval),    !(n->tree_info & OPT_EXTERNAL_DEPEND),    n->name);    emit1(F_CONSTANT, DO_NOT_WARN((INT32)tmp1));    return 1;    -  +  case T_TYPE: +  tmp1 = store_constant(&(n->u.sval), 0, n->name); +  emit1(F_CONSTANT, DO_NOT_WARN((INT32)tmp1)); +  return 1; +     case T_ARRAY:    case T_MAPPING:    case T_MULTISET:    tmp1=store_constant(&(n->u.sval),    !(n->tree_info & OPT_EXTERNAL_DEPEND),    n->name);    emit1(F_CONSTANT, DO_NOT_WARN((INT32)tmp1));       /* copy now or later ? */    if(!(flags & DO_NOT_COPY) && !(n->tree_info & OPT_EXTERNAL_DEPEND))