-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
Fixes #3094.
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
- 9.1.5.0
- 9.1.4.0
- 9.1.3.0
- 9.1.2.0
- 9.1.1.0
- 9.1.0.0
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1733,7 +1733,12 @@ public Operand buildDAsgn(final DAsgnNode dasgnNode) { | |
int depth = dasgnNode.getDepth(); | ||
Variable arg = getLocalVariable(dasgnNode.getName(), depth); | ||
Operand value = build(dasgnNode.getValueNode()); | ||
|
||
// no use copying a variable to itself | ||
if (arg == value) return value; | ||
|
||
addInstr(new CopyInstr(arg, value)); | ||
|
||
return value; | ||
|
||
// IMPORTANT: The return value of this method is value, not arg! | ||
|
@@ -1909,6 +1914,7 @@ protected void receiveNonBlockArgs(final ArgsNode argsNode) { | |
// Now for opt args | ||
if (opt > 0) { | ||
int optIndex = argsNode.getOptArgIndex(); | ||
Variable temp = createTemporaryVariable(); | ||
for (int j = 0; j < opt; j++, argIndex++) { | ||
// Jump to 'l' if this arg is not null. If null, fall through and build the default value! | ||
Label l = getNewLabel(); | ||
|
@@ -1917,10 +1923,12 @@ protected void receiveNonBlockArgs(final ArgsNode argsNode) { | |
Variable av = getNewLocalVariable(argName, 0); | ||
if (scope instanceof IRMethod) addArgumentDescription(ArgumentType.opt, argName); | ||
// You need at least required+j+1 incoming args for this opt arg to get an arg at all | ||
addInstr(new ReceiveOptArgInstr(av, signature.required(), signature.pre(), j)); | ||
addInstr(BNEInstr.create(l, av, UndefinedValue.UNDEFINED)); // if 'av' is not undefined, go to default | ||
build(n.getValue()); | ||
addInstr(new ReceiveOptArgInstr(temp, signature.required(), signature.pre(), j)); | ||
addInstr(BNEInstr.create(l, temp, UndefinedValue.UNDEFINED)); // if 'av' is not undefined, go to default | ||
Operand defaultResult = build(n.getValue()); | ||
addInstr(new CopyInstr(temp, defaultResult)); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
headius
Author
Member
|
||
addInstr(new LabelInstr(l)); | ||
addInstr(new CopyInstr(av, temp)); | ||
} | ||
} | ||
|
||
|
@@ -2752,7 +2760,12 @@ public Operand buildLiteral(LiteralNode literalNode) { | |
public Operand buildLocalAsgn(LocalAsgnNode localAsgnNode) { | ||
Variable var = getLocalVariable(localAsgnNode.getName(), localAsgnNode.getDepth()); | ||
Operand value = build(localAsgnNode.getValueNode()); | ||
|
||
// no use copying a variable to itself | ||
if (var == value) return value; | ||
|
||
addInstr(new CopyInstr(var, value)); | ||
|
||
return value; | ||
|
||
// IMPORTANT: The return value of this method is value, not var! | ||
|
Is this extra tmp juggling necessary? Won't the checks in buildLocalAsgn and buildDAsgn fix this?