Change 29539 by [EMAIL PROTECTED] on 2006/12/12 22:03:21
Oops. As of some point one stopped being able to assign integers and
floating point values to typeglobs.
Affected files ...
... //depot/perl/sv.c#1334 edit
... //depot/perl/t/op/glob.t#25 edit
Differences ...
==== //depot/perl/sv.c#1334 (text) ====
Index: perl/sv.c
--- perl/sv.c#1333~29535~ 2006-12-12 11:54:05.000000000 -0800
+++ perl/sv.c 2006-12-12 14:03:21.000000000 -0800
@@ -3376,6 +3376,8 @@
case SVt_PV:
sv_upgrade(dstr, SVt_PVIV);
break;
+ case SVt_PVGV:
+ goto end_of_first_switch;
}
(void)SvIOK_only(dstr);
SvIV_set(dstr, SvIVX(sstr));
@@ -3402,6 +3404,8 @@
case SVt_PVIV:
sv_upgrade(dstr, SVt_PVNV);
break;
+ case SVt_PVGV:
+ goto end_of_first_switch;
}
SvNV_set(dstr, SvNVX(sstr));
(void)SvNOK_only(dstr);
@@ -3474,6 +3478,7 @@
else
SvUPGRADE(dstr, (svtype)stype);
}
+ end_of_first_switch:
/* dstr may have been upgraded. */
dtype = SvTYPE(dstr);
==== //depot/perl/t/op/glob.t#25 (xtext) ====
Index: perl/t/op/glob.t
--- perl/t/op/glob.t#24~28057~ 2006-05-02 03:39:01.000000000 -0700
+++ perl/t/op/glob.t 2006-12-12 14:03:21.000000000 -0800
@@ -6,7 +6,7 @@
}
require 'test.pl';
-plan( tests => 12 );
+plan( tests => 15 );
@oops = @ops = <op/*>;
@@ -85,3 +85,10 @@
}
cmp_ok(scalar(@oops),'>',0,'glob globbed something');
+
+*aieee = 4;
+pass('Can assign integers to typeglobs');
+*aieee = 3.14;
+pass('Can assign floats to typeglobs');
+*aieee = 'pi';
+pass('Can assign strings to typeglobs');
End of Patch.