Branch: Tag:

2002-10-16

2002-10-16 15:20:53 by Henrik Grubbström (Grubba) <grubba@grubba.org>

If a constant node throws an error, the node isn't really a constant...

Rev: src/las.c:1.304

2:   || 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.303 2002/10/11 01:39:32 nilsson Exp $ + || $Id: las.c,v 1.304 2002/10/16 15:20:53 grubba Exp $   */      #include "global.h" - RCSID("$Id: las.c,v 1.303 2002/10/11 01:39:32 nilsson Exp $"); + RCSID("$Id: las.c,v 1.304 2002/10/16 15:20:53 grubba Exp $");      #include "language.h"   #include "interpret.h"
5332:       if(apply_low_safe_and_stupid(Pike_compiler->fake_object, jump))    { + #if 0    /* Generate error message */    if(!Pike_compiler->catch_level)    {
5339:    throw_value.type = T_INT;    yyerror("Error evaluating constant.\n");    push_svalue(&thrown); -  low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); +  low_safe_apply_handler("compile_exception", +  error_handler, compat_handler, 1);    if (SAFE_IS_ZERO(Pike_sp-1)) yy_describe_exception(&thrown);    pop_stack();    free_svalue(&thrown);
5348:    free_svalue(&throw_value);    throw_value.type = T_INT;    } + #else /* !0 */ +  free_svalue(&throw_value); +  throw_value.type = T_INT; +  /* Assume the node will throw errors at runtime too. */ +  n->tree_info |= OPT_SIDE_EFFECT; +  n->node_info |= OPT_SIDE_EFFECT; + #endif /* 0 */    }else{    if(foo.yes)    pop_n_elems(Pike_sp-save_sp);