2010/8/17 Heinz Knutzen <heinz.knut
...@gmx.de>:
> I would propose this patch, which fixes issue 35.
> --- /usr/local/lib/perl/5.10.1/B/CC.pm 2010-07-23 23:55:39.000000000
> +0200
> +++ B/CC.pm 2010-08-17 13:32:08.000000000 +0200
> @@ -604,7 +604,7 @@
> my $namesv = $namelist[$ix];
> my $type = T_UNKNOWN;
> my $flags = 0;
> - my $name = "tmp$ix";
> + my $name = "tmp";
> my $class = class($namesv);
> if ( !defined($namesv) || $class eq "SPECIAL" ) {
> # temporaries have &PL_sv_undef instead of a PVNV for a name
> @@ -628,8 +628,9 @@
> $flags |= REGISTER if $3;
> }
> }
> + $name = "${ix}_$name";
> $pad[$ix] =
> - B::Stackobj::Padsv->new( $type, $flags, $ix, "i_$name", "d_$name" );
> + B::Stackobj::Padsv->new( $type, $flags, $ix, "i$name", "d$name" );
This does not smell right since the new names should
start with i_ or d_ for consistency.
--- lib/B/CC.pm (revision 521)
+++ lib/B/CC.pm (working copy)
@@ -605,7 +605,7 @@
my $namesv = $namelist[$ix];
my $type = T_UNKNOWN;
my $flags = 0;
- my $name = "tmp$ix";
+ my $name = "tmp";
my $class = class($namesv);
if ( !defined($namesv) || $class eq "SPECIAL" ) {
# temporaries have &PL_sv_undef instead of a PVNV for a name
@@ -629,6 +629,7 @@
$flags |= REGISTER if $3;
}
}
+ $name = "$name$ix";
$pad[$ix] =
B::Stackobj::Padsv->new( $type, $flags, $ix, "i_$name", "d_$name" );
d_tmp5 sounds better than d5_tmp
> There seems to be some non-determinism in B::CC.
> When applying this patch, the offending variables "x" and "tmp5" aren't
> declared any longer in the resulting C code.
I get d_x2 and d_tmp5 which looks good to me, without the changed test.
> I had to change the test programs slightly to get them back.
> fail2.pl
> =====
> sub test {
> { my $x = 1; my $y = $x + 1;}
> my $x = 2;
> if ($x != 3) { 4; }
> }
> =====
> fail3.pl
> =====
> sub test {
> my $tmp5 = 1;
> my $x = $tmp5 + 1;
> if ($x != 3) { 4; }
> }
> =====
>> As a sidenote:
>> Do you think it is possible to add googlecode issues for future bugs
>> by yourself?
> For joining this mailing list I needed a google account already.
> I will add future issues to googlecode myself.
Great! Thanks.
I didn't know that you need a google account for joining the mailing
list at all.
This sounds like a blocker for future contributors.
>> If you have a google account I'll happily add you as "Project
>> contributor". (to add and resolve issues)
> What does it mean to resolve issues as contributor?
> Will I be able to change the code?
If you come up with more good patches I'll give you svn write access also.
contributer has issue permissions, not svn I believe.
> --
> Heinz Knutzen
--
Reini Urban