Skip to content

Commit

Permalink
Final failure for spec:compiler fixed.
Browse files Browse the repository at this point in the history
I had refactored all recv instrs so that they can use super to
encode but for recvrest the encode order swapped two elements
of the same time which decode would then reverse when reading
from IR persistence.
  • Loading branch information
enebo committed May 10, 2022
1 parent 9657344 commit 6d21eb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/IRBuilder.java
Expand Up @@ -2895,7 +2895,7 @@ protected void receiveNonBlockArgs(final ArgsNode argsNode, Variable keywords) {
// You need at least required+opt+1 incoming args for the rest arg to get any args at all
// If it is going to get something, then it should ignore required+opt args from the beginning
// because they have been accounted for already.
addInstr(new ReceiveRestArgInstr(argumentResult(argName), keywords, signature.required() + opt, argIndex));
addInstr(new ReceiveRestArgInstr(argumentResult(argName), keywords, argIndex, signature.required() + opt));
}

// Post(-opt and rest) required args
Expand Down
Expand Up @@ -21,7 +21,7 @@ public class ReceiveRestArgInstr extends ReceiveIndexedArgBase implements FixedA
/** Number of arguments already accounted for */
public final int required;

public ReceiveRestArgInstr(Variable result, Variable keywords, int required, int argIndex) {
public ReceiveRestArgInstr(Variable result, Variable keywords, int argIndex, int required) {
super(Operation.RECV_REST_ARG, result, keywords, argIndex);
this.required = required;
}
Expand All @@ -33,7 +33,7 @@ public String[] toStringNonOperandArgs() {

@Override
public Instr clone(CloneInfo info) {
if (info instanceof SimpleCloneInfo) return new ReceiveRestArgInstr(info.getRenamedVariable(result), info.getRenamedVariable(getKeywords()), required, argIndex);
if (info instanceof SimpleCloneInfo) return new ReceiveRestArgInstr(info.getRenamedVariable(result), info.getRenamedVariable(getKeywords()), argIndex, required);

InlineCloneInfo ii = (InlineCloneInfo) info;

Expand Down

0 comments on commit 6d21eb8

Please sign in to comment.