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.264 2001/08/16 00:36:47 mast Exp $"); + RCSID("$Id: las.c,v 1.265 2001/08/16 04:38:51 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:1683:      node *index_node(node *n, char *node_name, struct pike_string *id)   {    node *ret;    JMP_BUF tmp;       check_tree(n,0);       if(SETJMP(tmp))    { -  struct svalue s; -  assign_svalue_no_free(&s, &throw_value); +  struct svalue thrown = throw_value; +  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(&s); -  safe_apply_handler("compile_exception", error_handler, compat_handler, 1); -  if (IS_ZERO(sp-1)) yy_describe_exception(&s); +  push_svalue(&thrown); +  low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1); +  if (IS_ZERO(sp-1)) yy_describe_exception(&thrown);    pop_stack(); -  free_svalue(&s); +  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' "    "(module doesn't exist?)",    node_name, id->str);
pike.git/src/las.c:1779:    {    if (node_name) {    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) {    push_svalue(&thrown); -  safe_apply_handler("compile_exception", error_handler, compat_handler, 1); +  low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1);    if (IS_ZERO(sp-1)) yy_describe_exception(&thrown);    pop_stack();    free_svalue(&thrown);    }    }    }    END_CYCLIC();    }    }    }
pike.git/src/las.c:4993:       tmp_callback=add_to_callback(&evaluator_callbacks,    check_evaluation_time,    (void *)&foo,0);       if(apply_low_safe_and_stupid(Pike_compiler->fake_object, jump))    {    /* Generate error message */    if(!Pike_compiler->catch_level)    { -  if(throw_value.type == T_ARRAY && throw_value.u.array->size) -  { -  union anything *a; -  a=low_array_get_item_ptr(throw_value.u.array, 0, T_STRING); -  if(a) -  { -  yyerror(a->string->str); -  }else{ -  yyerror("Nonstandard error format."); -  } -  } -  else if(throw_value.type == T_OBJECT) -  { -  ref_push_object(throw_value.u.object); -  push_int(0); -  f_index(2); -  if(Pike_sp[-1].type != T_STRING) -  yyerror("Nonstandard error format."); -  else -  yyerror(Pike_sp[-1].u.string->str); +  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);    pop_stack(); -  +  free_svalue(&thrown);    } -  else -  { -  yyerror("Nonstandard error format."); -  } -  } +  else {    free_svalue(&throw_value);    throw_value.type = T_INT; -  +  }    }else{    if(foo.yes)    pop_n_elems(Pike_sp-save_sp);    else    ret=Pike_sp-save_sp;    }       remove_callback(tmp_callback);    }