Skip to content
Browse files

C: non-static only ~ and ~~ formatstrings

slight optimization, rarely needed
  • Loading branch information...
1 parent 6db0dbb commit ba9d6eb24f96ffa58969763f8ce595db918f4085 @rurban committed Jan 28, 2014
Showing with 10 additions and 3 deletions.
  1. +4 −0 Changes
  2. +6 −3 lib/B/C.pm
View
4 Changes
@@ -3,6 +3,10 @@
The Perl compiler was in CORE from alpha4 until Perl 5.9.4
and worked quite fine with Perl 5.6 and 5.8
+1.44 2014-?? rurban
+
+ * C: Fix -O3 with ~ and ~~ formatstrings (#277)
+
1.43 2014-01-15 rurban
new 5.16, and partial 5.18, 5.20 and windows support.
Many more fixes and testcases.
View
9 lib/B/C.pm
@@ -1242,9 +1242,12 @@ sub B::LISTOP::save {
} elsif ($op->type == $OP_FORMLINE) {
my $svop = $op->last;
if ($svop->name == 'const' and $B::C::const_strings) {
- #TODO non-static only when the const string contains ~ #277
- local $B::C::const_strings;
- do_labels ($op, 'last');
+ # non-static only when the const string contains ~ #277
+ my $sv = $svop->sv;
+ if ($sv->PV =~ /~/) {
+ local $B::C::const_strings;
+ $svop->save("svop const");
+ }
}
}
do_labels ($op, 'first', 'last');

0 comments on commit ba9d6eb

Please sign in to comment.
Something went wrong with that request. Please try again.