Fix NPE on error. #40
This commit is contained in:
@@ -50,7 +50,6 @@ public class FuncState extends Constants {
|
||||
Hashtable h; /* table to find (and reuse) elements in `k' */
|
||||
FuncState prev; /* enclosing function */
|
||||
LexState ls; /* lexical state */
|
||||
LuaC.CompileState L; /* compiler being invoked */
|
||||
BlockCnt bl; /* chain of current blocks */
|
||||
int pc; /* next position to code (equivalent to `ncode') */
|
||||
int lasttarget; /* `pc' of last `jump target' */
|
||||
@@ -113,8 +112,8 @@ public class FuncState extends Constants {
|
||||
void errorlimit (int limit, String what) {
|
||||
// TODO: report message logic.
|
||||
String msg = (f.linedefined == 0) ?
|
||||
L.pushfstring("main function has more than "+limit+" "+what) :
|
||||
L.pushfstring("function at line "+f.linedefined+" has more than "+limit+" "+what);
|
||||
ls.L.pushfstring("main function has more than "+limit+" "+what) :
|
||||
ls.L.pushfstring("function at line "+f.linedefined+" has more than "+limit+" "+what);
|
||||
ls.lexerror(msg, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user