Skip to content

Commit

Permalink
Make JIT not crash on simple method.parameters involving kwargs and r…
Browse files Browse the repository at this point in the history
…eturn proper values
  • Loading branch information
enebo committed Apr 7, 2015
1 parent a2ae622 commit 0bab673
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/src/main/java/org/jruby/runtime/Helpers.java
Expand Up @@ -2765,6 +2765,7 @@ public static RubyArray parameterListToParameters(Ruby runtime, String[] paramet
RubyArray parms = RubyArray.newEmptyArray(runtime);

for (String param : parameterList) {
if (param == null) continue; // FIXME: How does this happen?
if (param.equals("NONE")) break;

RubyArray elem = RubyArray.newEmptyArray(runtime);
Expand Down Expand Up @@ -2822,8 +2823,13 @@ public static String[] irMethodArgsToParameters(String[] argDesc) {
String type = argDesc[i];
i++;
String name = argDesc[i];
String encoded = type.charAt(0) + name;
tmp[i] = encoded;
if (type.equals("keyreq")) {
tmp[i] = "K" + name;
} else if (type.equals("keyrest")) {
tmp[i] = "e" + name;
} else {
tmp[i] = type.charAt(0) + name;
}
}

return tmp;
Expand Down

0 comments on commit 0bab673

Please sign in to comment.