Branch: Tag:

2007-01-15

2007-01-15 15:50:38 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Increased paranoia in efun::exit() with werror arguments.
Found by Klocwork.

Rev: src/builtin_functions.c:1.621

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: builtin_functions.c,v 1.620 2007/01/15 15:44:00 grubba Exp $ + || $Id: builtin_functions.c,v 1.621 2007/01/15 15:50:38 grubba Exp $   */      #include "global.h"
2487:    in_exit=1;       if(args>1 && Pike_sp[1-args].type==T_STRING) { -  apply_svalue(simple_mapping_string_lookup(get_builtin_constants(), -  "werror"), args-1); +  struct svalue *s = +  simple_mapping_string_lookup(get_builtin_constants(), "werror"); +  if (s) { +  apply_svalue(s, args-1);    pop_stack(); -  +  } else if (args > 1) { +  fprintf(stderr, "No efun::werror() at exit.\n"); +  pop_n_elems(args-1); +  }    args=1;    }