Permalink
Browse files

[GH #836] Catch also Scheduler.destroy and empty Undef bodies

  • Loading branch information...
1 parent 7913e25 commit ac0b13554d30aa8946be90f6095bdfbb61c7ea1d Reini Urban committed Sep 25, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/Parrot/Pmc2c/Method.pm
View
@@ -264,16 +264,18 @@ sub decl {
if ($args =~ s/, (\w+ \*?$key)/, SHIM($1)/) {
$body->{data} =~ s/^\s*UNUSED\((\w+)\);?\n//;
}
- if ($body->{data} =~ m/^\s*UNUSED\((INTERP|interp)\);?\n/) {
- $self->{interp_unused} = 1;
- warn "Replace UNUSED(interp) with UNUSED(INTERP) in $pmcname METHOD $meth\n"
- if $1 eq 'interp' and $self->{parent_name} ne 'Null';
- $body->{data} =~ s/^\s*UNUSED\((INTERP|interp)\);?\n//;
- }
if ($body->{data} =~ m/^\s*UNUSED\(SELF\);?\n/) {
$self->{pmc_unused} = 1;
$body->{data} =~ s/^\s*UNUSED\(SELF\);?\n//;
}
+ if ($body->{data} =~ m/^\s*UNUSED\((INTERP|interp)\);?\n/) {
+ $self->{interp_unused} = 1;
+ $body->{data} =~ s/^\s*UNUSED\((INTERP|interp)\);?\n//;
+ warn "Replace UNUSED(interp) with UNUSED(INTERP) in $pmcname METHOD $meth\n"
+ if $1 eq 'interp'
+ and $self->{parent_name} ne 'Null'
+ and $body->{data} != /^\s*$/;
+ }
}
my ( $extern, $newl, $semi );

0 comments on commit ac0b135

Please sign in to comment.