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.
|
||||
* 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.
|
||||
* @exclude
|
||||
* @hide
|
||||
*/
|
||||
Varargs dealias() {
|
||||
public Varargs dealias() {
|
||||
int n = narg();
|
||||
switch (n) {
|
||||
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) {
|
||||
this(f, name, opcode, iolib);
|
||||
this.toclose = toclose;
|
||||
this.args = args;
|
||||
this.args = args.dealias();
|
||||
}
|
||||
public IoLibV(File f, String name, int opcode, IoLib iolib) {
|
||||
super();
|
||||
|
||||
Reference in New Issue
Block a user