Skip to content

Commit

Permalink
[Pmc2c] "METHOD TYPE *foo()" fails at runtime with an NCI signature e…
Browse files Browse the repository at this point in the history
…rror,

when there's a space between TYPE and *.

Fix that by removing spaces from the type before doing the signature lookup.


git-svn-id: https://svn.parrot.org/parrot/trunk@20577 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
Infinoid committed Aug 9, 2007
1 parent fe303ec commit 438fe38
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Parrot/Pmc2c/PMCEmitter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ sub proto {
$parameters =~ s/\w+(,|$)/,/g;
$parameters =~ s/ //g;

# flatten whitespace before "*" in return value
$type =~ s/\s+\*$/\*/ if defined $type;

# type method(interp, self, parameters...)
my $ret = $calltype{ $type or "void" };
$ret .= "JO" . join( '', map { $calltype{$_} or "?" } split( /,/, $parameters ) );
Expand Down

0 comments on commit 438fe38

Please sign in to comment.