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.276 2001/12/16 01:17:23 mast Exp $"); + RCSID("$Id: las.c,v 1.277 2001/12/16 02:49:40 mast 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:1752:    throw_value.type = T_INT;       if (node_name) {    my_yyerror("Couldn't index module '%s'.", node_name);    } else {    yyerror("Couldn't index module.");    }       push_svalue(&thrown);    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); -  if (IS_ZERO(sp-1)) yy_describe_exception(&thrown); +  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown);    pop_stack();    free_svalue(&thrown);    }else{    resolv_constant(n);    switch(Pike_sp[-1].type)    {    case T_INT:    if(!Pike_compiler->num_parse_error) {    if (node_name) {    my_yyerror("Failed to index module '%s' with '%s' "
pike.git/src/las.c:1864:    my_yyerror("Index '%s' not present in module '%s'.",    id->str, node_name);    } else {    my_yyerror("Index '%s' not present in module.", id->str);    }       if (thrown.type != PIKE_T_UNKNOWN) {    *(Pike_sp++) = thrown;    thrown.type = PIKE_T_INT;    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); -  if (IS_ZERO(sp-1)) yy_describe_exception(&thrown); +  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown);    pop_stack();    }    }else if (!force_resolve) {    /* Hope it's there in pass 2 */    pop_stack();    ref_push_object(placeholder_object);    if (thrown.type != PIKE_T_UNKNOWN)    free_svalue(&thrown);    }    }
pike.git/src/las.c:2236:    OPT_RETURN    ));   }      /* this one supposes that the value is optimized */   int node_is_true(node *n)   {    if(!n) return 0;    switch(n->token)    { -  case F_CONSTANT: return !IS_ZERO(& n->u.sval); +  case F_CONSTANT: return !SAFE_IS_ZERO(& n->u.sval);    default: return 0;    }   }      /* this one supposes that the value is optimized */   int node_is_false(node *n)   {    if(!n) return 0;    switch(n->token)    { -  case F_CONSTANT: return IS_ZERO(& n->u.sval); +  case F_CONSTANT: return SAFE_IS_ZERO(& n->u.sval);    default: return 0;    }   }      int node_may_overload(node *n, int lfun)   {    if(!n) return 0;    if(!n->type) return 1;    return type_may_overload(n->type, lfun);   }
pike.git/src/las.c:3750:   #endif /* SHARED_NODES */    break;    }    } else if(Pike_compiler->compiler_frame &&    Pike_compiler->compiler_frame->current_return_type) {    if (!pike_types_le(CAR(n)->type,    Pike_compiler->compiler_frame->current_return_type) &&    !(    Pike_compiler->compiler_frame->current_return_type==void_type_string &&    CAR(n)->token == F_CONSTANT && -  IS_ZERO(& CAR(n)->u.sval) +  SAFE_IS_ZERO(& CAR(n)->u.sval)    )    ) {    if (!match_types(Pike_compiler->compiler_frame->current_return_type,    CAR(n)->type))    {    yyerror("Wrong return type.");    yyexplain_nonmatching_types(Pike_compiler->compiler_frame->current_return_type,    CAR(n)->type, 0);    }    else if (lex.pragmas & ID_STRICT_TYPES)
pike.git/src/las.c:5148:    if(apply_low_safe_and_stupid(Pike_compiler->fake_object, jump))    {    /* Generate error message */    if(!Pike_compiler->catch_level)    {    struct svalue thrown = throw_value;    throw_value.type = T_INT;    yyerror("Error evaluating constant.\n");    push_svalue(&thrown);    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); -  if (IS_ZERO(sp-1)) yy_describe_exception(&thrown); +  if (SAFE_IS_ZERO(sp-1)) yy_describe_exception(&thrown);    pop_stack();    free_svalue(&thrown);    }    else {    free_svalue(&throw_value);    throw_value.type = T_INT;    }    }else{    if(foo.yes)    pop_n_elems(Pike_sp-save_sp);
pike.git/src/las.c:5217:    return n;    break;       case 0:    if(Pike_compiler->catch_level) return n;    free_node(n);    n=0;    break;       case 1: -  if(Pike_compiler->catch_level && IS_ZERO(Pike_sp-1)) +  if(Pike_compiler->catch_level && SAFE_IS_ZERO(Pike_sp-1))    {    pop_stack();    return n;    }    if (n->token == F_SOFT_CAST) {    new = mksoftcastnode(n->type, mksvaluenode(Pike_sp-1));    } else {    new = mksvaluenode(Pike_sp-1);    if (n->type && (!new->type || ((n->type != new->type) &&    pike_types_le(n->type,new->type)))) {