pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.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: opcodes.c,v 1.134 2003/01/26 16:15:05 mirar Exp $ + || $Id: opcodes.c,v 1.135 2003/02/08 03:49:22 mast Exp $   */      #include "global.h"   #include <errno.h>   #include <math.h>   #include <ctype.h>   #include "interpret.h"   #include "svalue.h"   #include "array.h"   #include "stralloc.h"
pike.git/src/opcodes.c:23:   #include "fd_control.h"   #include "cyclic.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h"   #include "bignum.h"   #include "operators.h"      #define sp Pike_sp    - RCSID("$Id: opcodes.c,v 1.134 2003/01/26 16:15:05 mirar Exp $"); + RCSID("$Id: opcodes.c,v 1.135 2003/02/08 03:49:22 mast Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {    INT32 i;      #ifdef PIKE_SECURITY    if(what->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX))    Pike_error("Index permission denied.\n");   #endif
pike.git/src/opcodes.c:182:    */      /* Special case for casting to int. */   void o_cast_to_int(void)   {    switch(sp[-1].type)    {    case T_OBJECT:    {    struct pike_string *s; -  MAKE_CONSTANT_SHARED_STRING(s, "int"); +  REF_MAKE_CONST_STRING(s, "int");    push_string(s);    if(!sp[-2].u.object->prog)    Pike_error("Cast called on destructed object.\n");    if(FIND_LFUN(sp[-2].u.object->prog,LFUN_CAST) == -1)    Pike_error("No cast method in object.\n");    apply_lfun(sp[-2].u.object, LFUN_CAST, 1);    free_svalue(sp-2);    sp[-2]=sp[-1];    sp--;    dmalloc_touch_svalue(sp);    }    if(sp[-1].type != PIKE_T_INT)    {    if(sp[-1].type == T_OBJECT && sp[-1].u.object->prog)    {    int f=FIND_LFUN(sp[-1].u.object->prog, LFUN__IS_TYPE);    if( f != -1)    {    struct pike_string *s; -  MAKE_CONSTANT_SHARED_STRING(s, "int"); +  REF_MAKE_CONST_STRING(s, "int");    push_string(s);    apply_low(sp[-2].u.object, f, 1);    f=!UNSAFE_IS_ZERO(sp-1);    pop_stack();    if(f) return;    }    }    Pike_error("Cast failed, wanted int, got %s\n",    get_name_of_type(sp[-1].type));    }
pike.git/src/opcodes.c:293:   {    char buf[200];    switch(sp[-1].type)    {    case PIKE_T_STRING:    return;       case T_OBJECT:    {    struct pike_string *s; -  MAKE_CONSTANT_SHARED_STRING(s, "string"); +  REF_MAKE_CONST_STRING(s, "string");    push_string(s);    if(!sp[-2].u.object->prog)    Pike_error("Cast called on destructed object.\n");    if(FIND_LFUN(sp[-2].u.object->prog,LFUN_CAST) == -1)    Pike_error("No cast method in object.\n");    apply_lfun(sp[-2].u.object, LFUN_CAST, 1);    free_svalue(sp-2);    sp[-2]=sp[-1];    sp--;    dmalloc_touch_svalue(sp);    }    if(sp[-1].type != PIKE_T_STRING)    {    if(sp[-1].type == T_OBJECT && sp[-1].u.object->prog)    {    int f=FIND_LFUN(sp[-1].u.object->prog, LFUN__IS_TYPE);    if( f != -1)    {    struct pike_string *s; -  MAKE_CONSTANT_SHARED_STRING(s, "string"); +  REF_MAKE_CONST_STRING(s, "string");    push_string(s);    apply_low(sp[-2].u.object, f, 1);    f=!UNSAFE_IS_ZERO(sp-1);    pop_stack();    if(f) return;    }    }    Pike_error("Cast failed, wanted string, got %s\n",    get_name_of_type(sp[-1].type));    }