Permalink
Browse files

Fix segv in constant folding of xor ops.

github 40

And add a test.
  • Loading branch information...
1 parent 4dcb8b7 commit c7e90d15d61c5d5c79ab6fa4d3cf6280c015353a @pjcj committed Jan 5, 2013
Showing with 45 additions and 0 deletions.
  1. +1 −0 Changes
  2. +2 −0 Cover.xs
  3. +32 −0 test_output/cover/xor_constant_fold.5.006001
  4. +10 −0 tests/xor_constant_fold
View
@@ -1,6 +1,7 @@
Devel::Cover history
{{$NEXT}}
+ - Fix segv in constant folding of xor ops (gitbub 40).
Release 0.99 - 31 December 2012
- Improve documentation (Olaf Alders) (github 34).
View
@@ -824,6 +824,8 @@ static void cover_logop(pTHX)
#else
next = PL_op->op_next;
#endif
+ if (PL_op->op_type == OP_XOR && !next)
+ return; /* in fold_constants */
NDEB(op_dump(PL_op));
NDEB(op_dump(next));
@@ -0,0 +1,32 @@
+Reading database from ...
+
+
+------------------------------------------ ------ ------ ------ ------ ------
+File stmt bran cond sub total
+------------------------------------------ ------ ------ ------ ------ ------
+tests/xor_constant_fold 100.0 n/a n/a n/a 100.0
+Total 100.0 n/a n/a n/a 100.0
+------------------------------------------ ------ ------ ------ ------ ------
+
+
+Run: ...
+Perl version: ...
+OS: ...
+Start: ...
+Finish: ...
+
+tests/xor_constant_fold
+
+line err stmt bran cond sub code
+1 #!/usr/bin/perl
+2
+3 # Copyright 2004-2012, Paul Johnson (paul@pjcj.net)
+4
+5 # This software is free. It is licensed under the same terms as Perl itself.
+6
+7 # The latest version of this software should be available from my homepage:
+8 # http://www.pjcj.net
+9
+10 1 1 xor 0;
+
+
View
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+
+# Copyright 2004-2012, Paul Johnson (paul@pjcj.net)
+
+# This software is free. It is licensed under the same terms as Perl itself.
+
+# The latest version of this software should be available from my homepage:
+# http://www.pjcj.net
+
+1 xor 0;

0 comments on commit c7e90d1

Please sign in to comment.