Change 32971 by [EMAIL PROTECTED] on 2008/01/13 20:58:56
Re-order so that the !SvOK() case is last (which should be rare)
Remove the FIXME comment as I had already fixed it.
Affected files ...
... //depot/perl/pp.c#619 edit
Differences ...
==== //depot/perl/pp.c#619 (text) ====
Index: perl/pp.c
--- perl/pp.c#618~32969~ 2008-01-12 14:20:39.000000000 -0800
+++ perl/pp.c 2008-01-13 12:58:56.000000000 -0800
@@ -3018,11 +3018,7 @@
dVAR; dSP; dTARGET;
SV * const sv = TOPs;
- if (!SvOK(sv) && !SvGMAGICAL(sv)) {
- /* FIXME - this doesn't allow GMAGIC to return undef for consistency.
- */
- SETs(&PL_sv_undef);
- } else if (SvGAMAGIC(sv)) {
+ if (SvGAMAGIC(sv)) {
/* For an overloaded or magic scalar, we can't know in advance if
it's going to be UTF-8 or not. Also, we can't call sv_len_utf8 as
it likes to cache the length. Maybe that should be a documented
@@ -3040,12 +3036,14 @@
}
else
SETi(len);
- } else {
+ } else if (SvOK(sv)) {
/* Neither magic nor overloaded. */
if (DO_UTF8(sv))
SETi(sv_len_utf8(sv));
else
SETi(sv_len(sv));
+ } else {
+ SETs(&PL_sv_undef);
}
RETURN;
}
End of Patch.