Created
May 10, 2011 17:10
-
-
Save anonymous/964912 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 96ce33ce86950c0b2e8ca6c0114e282decf78125 Mon Sep 17 00:00:00 2001 | |
From: Florian Ragwitz <rafl@debian.org> | |
Date: Tue, 10 May 2011 19:10:19 +0200 | |
Subject: [PATCH] Don't return pointers to stale pad entries | |
--- | |
PadWalker.xs | 3 ++- | |
1 files changed, 2 insertions(+), 1 deletions(-) | |
diff --git a/PadWalker.xs b/PadWalker.xs | |
index 30dd427..4ad69af 100644 | |
--- a/PadWalker.xs | |
+++ b/PadWalker.xs | |
@@ -244,7 +244,8 @@ pads_into_hash(AV* pad_namelist, AV* pad_vallist, HV* my_hash, HV* our_hash, U32 | |
else | |
{ | |
val_ptr = pad_vallist ? av_fetch(pad_vallist, i, 0) : 0; | |
- val_sv = val_ptr ? *val_ptr : &PL_sv_undef; | |
+ val_sv = val_ptr && *val_ptr && !SvPADSTALE(*val_ptr) | |
+ ? *val_ptr : &PL_sv_undef; | |
} | |
hv_store((is_our ? our_hash : my_hash), name_str, name_len, | |
-- | |
1.7.5.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment