Fix nil processing in compiler
This commit is contained in:
@@ -48,6 +48,10 @@ public class LuaNil extends LuaValue {
|
||||
public int type() {
|
||||
return LuaValue.TNIL;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "nil";
|
||||
}
|
||||
|
||||
public String typename() {
|
||||
return "nil";
|
||||
|
||||
@@ -21,18 +21,16 @@
|
||||
******************************************************************************/
|
||||
package org.luaj.vm2.compiler;
|
||||
|
||||
import org.luaj.vm2.LuaBoolean;
|
||||
import org.luaj.vm2.LuaDouble;
|
||||
import org.luaj.vm2.LuaInteger;
|
||||
import org.luaj.vm2.LocVars;
|
||||
import org.luaj.vm2.Lua;
|
||||
import org.luaj.vm2.LuaNil;
|
||||
import org.luaj.vm2.LuaDouble;
|
||||
import org.luaj.vm2.LuaInteger;
|
||||
import org.luaj.vm2.LuaString;
|
||||
import org.luaj.vm2.LuaTable;
|
||||
import org.luaj.vm2.LuaUserdata;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.Prototype;
|
||||
import org.luaj.vm2.Upvaldesc;
|
||||
import org.luaj.vm2.LuaString;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.compiler.LexState.ConsControl;
|
||||
import org.luaj.vm2.compiler.LexState.expdesc;
|
||||
|
||||
@@ -489,7 +487,7 @@ public class FuncState extends LuaC {
|
||||
final Prototype f = this.f;
|
||||
if (f.k == null || nk + 1 >= f.k.length)
|
||||
f.k = realloc( f.k, nk*2 + 1 );
|
||||
f.k[this.nk++] = v;
|
||||
f.k[this.nk++] = v.isuserdata()? LuaValue.NIL: v;
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user