Branch: Tag:

2010-02-08

2010-02-08 17:40:10 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed issue where PikeCompiler()->apply_attribute_constant() could throw errors for unevaluated constant expressions.

Rev: src/program.c:1.774

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: program.c,v 1.773 2009/11/28 13:36:21 mast Exp $ + || $Id: program.c,v 1.774 2010/02/08 17:40:10 grubba Exp $   */      #include "global.h"
9208:    struct compilation *c = THIS_COMPILATION;    struct pike_string *attribute;    struct pike_string *test; -  get_all_args("apply_attribute_constant", args, "%S", &attribute); +  struct svalue *sval; +  get_all_args("apply_attribute_constant", args, "%S%*", &attribute, &sval); +  +  if ((sval->type == T_INT) && !sval->u.integer) { +  pop_n_elems(args); +  push_undefined(); +  return; +  } +     MAKE_CONST_STRING(test, "sprintf_format");    if (attribute == test) {    f___handle_sprintf_format(args);