-
-
Save headius/ecb1281bb3642daec3365fec428103de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/src/main/java/org/jruby/ir/IRBuilder.java b/core/src/main/java/org/jruby/ir/IRBuilder.java | |
index b27f350233..49aebd9e90 100644 | |
--- a/core/src/main/java/org/jruby/ir/IRBuilder.java | |
+++ b/core/src/main/java/org/jruby/ir/IRBuilder.java | |
@@ -630,6 +630,8 @@ public class IRBuilder { | |
Variable ret = getValueInTemporaryVariable(values); | |
if (valueNode instanceof ArrayNode) { | |
buildMultipleAsgn19Assignment(multipleAsgnNode, null, ret); | |
+ } else if (valueNode instanceof SideEffectFree){ | |
+ buildMultipleAsgn19Assignment(multipleAsgnNode, null, ret); | |
} else { | |
Variable tmp = createTemporaryVariable(); | |
addInstr(new ToAryInstr(tmp, ret)); | |
@@ -3156,6 +3158,15 @@ public class IRBuilder { | |
for (Node an: masgnPre.children()) { | |
if (values == null) { | |
buildArgsMasgn(an, argsArray, false, -1, -1, i, false); | |
+ } else if (values.canCopyPropagate()) { | |
+ Variable rhsVal = createTemporaryVariable(); | |
+ // assign first argument to copy of value, rest get nil | |
+ if (i == 0) { | |
+ addInstr(new CopyInstr(rhsVal, values)); | |
+ } else { | |
+ addInstr(new CopyInstr(rhsVal, new Nil())); | |
+ } | |
+ assigns.add(new Tuple<>(an, rhsVal)); | |
} else { | |
Variable rhsVal = createTemporaryVariable(); | |
addInstr(new ReqdArgMultipleAsgnInstr(rhsVal, values, i)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment