Branch: Tag:

2009-04-22

2009-04-22 17:17:55 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Pike 7.6 and earlier compat for store_constant(UNDEFINED).
Note that this behaviour is usually not something you'd want, but apparently there's code out there needing it.

Rev: src/program.c:1.761

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.760 2009/03/12 17:31:36 grubba Exp $ + || $Id: program.c,v 1.761 2009/04/22 17:17:55 grubba Exp $   */      #include "global.h"
6192:    if (foo->type == c->sval.type) {    /* Make sure only to compare within the same basic type. */    if (foo->type == T_OBJECT) { -  /* Special case objects -- We don't want stange LFUN effects... */ +  /* Special case objects -- We don't want strange LFUN effects... */    if ((foo->u.object == c->sval.u.object) &&    (foo->subtype == c->sval.subtype)) {    UNSETJMP(jmp);
6200:    }    } else if (foo->type == T_INT) {    if (foo->u.integer == c->sval.u.integer) { -  if (foo->u.integer || (foo->subtype == c->sval.subtype)) { +  /* Make sure UNDEFINED is kept (but not in compat mode). */ +  if (foo->u.integer || (foo->subtype == c->sval.subtype) || +  TEST_COMPAT(7, 6)) {    UNSETJMP(jmp);    return e;    }
7007:    * NOTE: The format string fmt (and vargs) is only formatted with    * string_builder_vsprintf() if the number of extra    * Pike stack arguments (args) is zero. +  * +  * NOTE: This function may be called from functions that sometimes +  * execute outside of the compilation context, eg by +  * __handle_sprintf_format(), which can be called directly +  * by Pike-code, in which case it is a NO-OP.    */   PMOD_EXPORT void va_yyreport(int severity_level,    struct pike_string *file, INT32 line,