1N/A * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 1N/A * 2000, 2001, 2002, 2003, 2004, by Larry Wall and others 1N/A * You may distribute under the terms of either the GNU General Public 1N/A * License or the Artistic License, as specified in the README file. 1N/A * "For the fashion of Minas Tirith was such that it was built on seven 1N/A /* Without any kind of initialising PUSHSUBST() 1N/A * in pp_subst() will read uninitialised heap. */ 1N/A /* Without any kind of initialising deep enough recursion 1N/A * will end up reading uninitialised PERL_CONTEXTs. */ 1N/A /* XXX should tmps_floor live in cxstack? */ 1N/A /* XXX SvMAGIC() is *shared* between osv and sv. This can 1N/A * lead to coredumps when both SVs are destroyed without one 1N/A * of their SvMAGIC() slots being NULLed. */ 1N/A/* Like save_sptr(), but also SvREFCNT_dec()s the new value. Can be used to 1N/A * restore a global SV to its prior contents, freeing new value. */ 1N/A/* Like save_pptr(), but also Safefree()s the new value if it is different 1N/A * from the old one. Can be used to restore a global char* to its prior 1N/A * contents, freeing new value. */ 1N/A/* Like save_generic_pvref(), but uses PerlMemShared_free() rather than Safefree(). 1N/A * Can be used to restore a shared global char* to its prior 1N/A * contents, freeing new value. */ 1N/A SvLEN(
gv) = 0;
/* forget that anything was allocated here */ 1N/A/* Cannot use save_sptr() to store a char* since the SV** cast will 1N/A * force word-alignment and we'll miss the pointer. 1N/A#
endif /* USE_5005THREADS */ 1N/A /* if it gets reified later, the restore will have the wrong refcnt */ 1N/A /* If we're localizing a tied array element, this new sv 1N/A * won't actually be stored in the array - so it won't get 1N/A * reaped when the localize ends. Ensure it gets reaped by 1N/A * mortifying it instead. DAPM */ 1N/A /* If we're localizing a tied hash element, this new sv 1N/A * won't actually be stored in the hash - so it won't get 1N/A * reaped when the localize ends. Ensure it gets reaped by 1N/A * mortifying it instead. DAPM */ 1N/A /* SSCHECK may not be good enough */ 1N/A "restore svref: %p %p:%s -> %p:%s\n",
1N/A /* XXX This branch is pretty bogus. This code irretrievably 1N/A * clears(!) the magic on the SV (either to avoid further 1N/A * croaking that might ensue when the SvSETMAGIC() below is 1N/A * called, or to avoid two different SVs pointing at the same 1N/A * SvMAGIC()). This needs a total rethink. --GSAR */ 1N/A /* XXX this is a leak when we get here because the 1N/A * mg_get() in save_scalar_at() croaked */ 1N/A if (
av)
/* actually an av, hv or gv */ 1N/A /* Can clear pad variable in place? */ 1N/A * if a my variable that was made readonly is going out of 1N/A * scope, we want to remove the readonlyness so that it can 1N/A * go out of scope quietly 1N/A else {
/* Someone has a claim on this, so abandon it. */ 1N/A switch (
SvTYPE(
sv)) {
/* Console ourselves with a new value */ 1N/A#
endif /* DEBUGGING */