Change 32738 by [EMAIL PROTECTED] on 2007/12/26 18:53:48
Tweak Perl_sv_upgrade() so that references can upgrade to SVt_PV
rather than something bigger. Fix a possible bug - "reference" to
SVt_NV needs to go direct to SVt_PVNV.
Affected files ...
... //depot/perl/sv.c#1453 edit
Differences ...
==== //depot/perl/sv.c#1453 (text) ====
Index: perl/sv.c
--- perl/sv.c#1452~32737~ 2007-12-26 10:12:32.000000000 -0800
+++ perl/sv.c 2007-12-26 10:53:48.000000000 -0800
@@ -1095,6 +1095,9 @@
#endif
+static const struct body_details fake_rv =
+ { 0, 0, 0, SVt_IV, FALSE, NONV, NOARENA, 0 };
+
/*
=for apidoc sv_upgrade
@@ -1113,7 +1116,7 @@
void* new_body;
const svtype old_type = SvTYPE(sv);
const struct body_details *new_type_details;
- const struct body_details *const old_type_details
+ const struct body_details *old_type_details
= bodies_by_type + old_type;
SV *referant = NULL;
@@ -1170,11 +1173,9 @@
case SVt_IV:
if (SvROK(sv)) {
referant = SvRV(sv);
- if (new_type < SVt_PVIV) {
- new_type = SVt_PVIV;
- /* FIXME to check SvROK(sv) ? SVt_PV : and fake up
- old_body_details */
- }
+ old_type_details = &fake_rv;
+ if (new_type == SVt_NV)
+ new_type = SVt_PVNV;
} else {
if (new_type < SVt_PVIV) {
new_type = (new_type == SVt_NV)
End of Patch.