Fix [RT#66098] -- stricter checking on SvIVX exposed a lack of SvIOK check
authorAlex Vandiver <alexmv@mit.edu>
Thu, 28 May 2009 20:27:25 +0000 (16:27 -0400)
committerDavid Mitchell <davem@iabyn.com>
Wed, 10 Jun 2009 12:14:42 +0000 (13:14 +0100)
(cherry picked from commit b8de32d59998a5999bfdf82297af4ccc75421091)

op.c
t/op/split.t

diff --git a/op.c b/op.c
index 8b9ee49..5a7d95e 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4298,7 +4298,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
                      ((LISTOP*)right)->op_last->op_type == OP_CONST)
                    {
                        SV *sv = ((SVOP*)((LISTOP*)right)->op_last)->op_sv;
-                       if (SvIVX(sv) == 0)
+                       if (SvIOK(sv) && SvIVX(sv) == 0)
                            sv_setiv(sv, PL_modcount+1);
                    }
                }
index 025327f..b3a9741 100755 (executable)
@@ -6,7 +6,7 @@ BEGIN {
     require './test.pl';
 }
 
-plan tests => 135;
+plan tests => 136;
 
 $FS = ':';
 
@@ -358,3 +358,9 @@ ok(@ary == 3 &&
     is($s[2]," XYZ");
     is(join(':',@s), join(':',@r));
 }
+
+{
+    use constant BANG => {};
+    () = split m/,/, "", BANG;
+    ok(1);
+}