Fix corrupted args for io.lines and file:lines on reuse stack elements.
This commit is contained in:
@@ -707,8 +707,10 @@ public abstract class Varargs {
|
|||||||
/** Return Varargs that cannot be using a shared array for the storage, and is flattened.
|
/** Return Varargs that cannot be using a shared array for the storage, and is flattened.
|
||||||
* Internal utility method not intended to be called directly from user code.
|
* Internal utility method not intended to be called directly from user code.
|
||||||
* @return Varargs containing same values, but flattened and with a new array if needed.
|
* @return Varargs containing same values, but flattened and with a new array if needed.
|
||||||
|
* @exclude
|
||||||
|
* @hide
|
||||||
*/
|
*/
|
||||||
Varargs dealias() {
|
public Varargs dealias() {
|
||||||
int n = narg();
|
int n = narg();
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 0: return LuaValue.NONE;
|
case 0: return LuaValue.NONE;
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ public class IoLib extends TwoArgFunction {
|
|||||||
public IoLibV(File f, String name, int opcode, IoLib iolib, boolean toclose, Varargs args) {
|
public IoLibV(File f, String name, int opcode, IoLib iolib, boolean toclose, Varargs args) {
|
||||||
this(f, name, opcode, iolib);
|
this(f, name, opcode, iolib);
|
||||||
this.toclose = toclose;
|
this.toclose = toclose;
|
||||||
this.args = args;
|
this.args = args.dealias();
|
||||||
}
|
}
|
||||||
public IoLibV(File f, String name, int opcode, IoLib iolib) {
|
public IoLibV(File f, String name, int opcode, IoLib iolib) {
|
||||||
super();
|
super();
|
||||||
|
|||||||
Reference in New Issue
Block a user