Program: 44026
Project: 44026
Buggy source:
public boolean luaStackCall(VM vm){
switch (id) {
case ASSERT:
{
      if (!vm.getArgAsBoolean(0)) {
        String message;
        if (vm.getArgCount() > 1) {
          message=vm.getArgAsString(1);
        }
 else {
          message="String_Node_Str";
        }
        throw new RuntimeException(message);
      }
      vm.setResult();
    }
  break;
case LOADFILE:
loadfile(vm,vm.getArgAsString(0));
break;
case TONUMBER:
vm.setResult(toNumber(vm));
break;
case RAWGET:
{
LValue t=vm.getArg(0);
LValue k=vm.getArg(1);
LValue result=LNil.NIL;
if (t instanceof LTable) {
result=((LTable)t).get(k);
}
vm.setResult(result);
}
break;
case RAWSET:
{
LValue t=vm.getArg(0);
LValue k=vm.getArg(1);
LValue v=vm.getArg(2);
vm.setResult();
if (t instanceof LTable) {
((LTable)t).put(k,v);
}
 else {
vm.error("String_Node_Str");
}
}
break;
case SETFENV:
setfenv((StackState)vm);
break;
case SELECT:
select(vm);
break;
case COLLECTGARBAGE:
System.gc();
vm.setResult();
break;
case DOFILE:
dofile(vm);
break;
case LOADSTRING:
loadstring(vm,vm.getArg(0),vm.getArgAsString(1));
break;
case LOAD:
load(vm,vm.getArg(0),vm.getArgAsString(1));
break;
case TOSTRING:
vm.setResult(tostring(vm,vm.getArg(0)));
break;
case UNPACK:
unpack(vm);
break;
case NEXT:
vm.setResult(next(vm,vm.getArg(0),vm.getArgAsInt(1)));
break;
case MODULE:
module(vm);
break;
case REQUIRE:
require(vm);
break;
case ABS:
vm.setResult(abs(vm.getArg(0)));
break;
case COS:
vm.setResult(new LDouble(Math.cos(vm.getArgAsDouble(0))));
break;
case MAX:
vm.setResult(max(vm.getArg(0),vm.getArg(1)));
break;
case MIN:
vm.setResult(min(vm.getArg(0),vm.getArg(1)));
break;
case MODF:
modf(vm);
break;
case SIN:
vm.setResult(new LDouble(Math.sin(vm.getArgAsDouble(0))));
break;
case SQRT:
vm.setResult(new LDouble(Math.sqrt(vm.getArgAsDouble(0))));
break;
case CEIL:
vm.setResult(LInteger.valueOf((int)Math.ceil(vm.getArgAsDouble(0))));
break;
case FLOOR:
vm.setResult(LInteger.valueOf((int)Math.floor(vm.getArgAsDouble(0))));
break;
case BYTE:
StrLib.byte_(vm);
break;
case CHAR:
StrLib.char_(vm);
break;
case DUMP:
StrLib.dump(vm);
break;
case FIND:
StrLib.find(vm);
break;
case FORMAT:
StrLib.format(vm);
break;
case GMATCH:
StrLib.gmatch(vm);
break;
case GSUB:
StrLib.gsub(vm);
break;
case LEN:
StrLib.len(vm);
break;
case LOWER:
StrLib.lower(vm);
break;
case MATCH:
StrLib.match(vm);
break;
case REP:
StrLib.rep(vm);
break;
case REVERSE:
StrLib.reverse(vm);
break;
case SUB:
StrLib.sub(vm);
break;
case UPPER:
StrLib.upper(vm);
break;
case LOADLIB:
loadlib(vm);
break;
case SEEALL:
seeall(vm);
break;
case CONCAT:
concat(vm);
break;
case INSERT:
insert(vm);
break;
case MAXN:
maxn(vm);
break;
case REMOVE:
remove(vm);
break;
case SORT:
sort(vm);
break;
default :
luaUnsupportedOperation();
}
return false;
}

Fixed version (ground truth):
public boolean luaStackCall(VM vm){
switch (id) {
case LOADFILE:
    loadfile(vm,vm.getArgAsString(0));
  break;
case TONUMBER:
vm.setResult(toNumber(vm));
break;
case RAWGET:
{
LValue t=vm.getArg(0);
LValue k=vm.getArg(1);
LValue result=LNil.NIL;
if (t instanceof LTable) {
result=((LTable)t).get(k);
}
vm.setResult(result);
}
break;
case RAWSET:
{
LValue t=vm.getArg(0);
LValue k=vm.getArg(1);
LValue v=vm.getArg(2);
vm.setResult();
if (t instanceof LTable) {
((LTable)t).put(k,v);
}
 else {
vm.error("String_Node_Str");
}
}
break;
case SETFENV:
setfenv((StackState)vm);
break;
case SELECT:
select(vm);
break;
case COLLECTGARBAGE:
System.gc();
vm.setResult();
break;
case DOFILE:
dofile(vm);
break;
case LOADSTRING:
loadstring(vm,vm.getArg(0),vm.getArgAsString(1));
break;
case LOAD:
load(vm,vm.getArg(0),vm.getArgAsString(1));
break;
case TOSTRING:
vm.setResult(tostring(vm,vm.getArg(0)));
break;
case UNPACK:
unpack(vm);
break;
case NEXT:
vm.setResult(next(vm,vm.getArg(0),vm.getArgAsInt(1)));
break;
case MODULE:
module(vm);
break;
case REQUIRE:
require(vm);
break;
case ABS:
vm.setResult(abs(vm.getArg(0)));
break;
case COS:
vm.setResult(new LDouble(Math.cos(vm.getArgAsDouble(0))));
break;
case MAX:
vm.setResult(max(vm.getArg(0),vm.getArg(1)));
break;
case MIN:
vm.setResult(min(vm.getArg(0),vm.getArg(1)));
break;
case MODF:
modf(vm);
break;
case SIN:
vm.setResult(new LDouble(Math.sin(vm.getArgAsDouble(0))));
break;
case SQRT:
vm.setResult(new LDouble(Math.sqrt(vm.getArgAsDouble(0))));
break;
case CEIL:
vm.setResult(LInteger.valueOf((int)Math.ceil(vm.getArgAsDouble(0))));
break;
case FLOOR:
vm.setResult(LInteger.valueOf((int)Math.floor(vm.getArgAsDouble(0))));
break;
case BYTE:
StrLib.byte_(vm);
break;
case CHAR:
StrLib.char_(vm);
break;
case DUMP:
StrLib.dump(vm);
break;
case FIND:
StrLib.find(vm);
break;
case FORMAT:
StrLib.format(vm);
break;
case GMATCH:
StrLib.gmatch(vm);
break;
case GSUB:
StrLib.gsub(vm);
break;
case LEN:
StrLib.len(vm);
break;
case LOWER:
StrLib.lower(vm);
break;
case MATCH:
StrLib.match(vm);
break;
case REP:
StrLib.rep(vm);
break;
case REVERSE:
StrLib.reverse(vm);
break;
case SUB:
StrLib.sub(vm);
break;
case UPPER:
StrLib.upper(vm);
break;
case LOADLIB:
loadlib(vm);
break;
case SEEALL:
seeall(vm);
break;
case CONCAT:
concat(vm);
break;
case INSERT:
insert(vm);
break;
case MAXN:
maxn(vm);
break;
case REMOVE:
remove(vm);
break;
case SORT:
sort(vm);
break;
default :
luaUnsupportedOperation();
}
return false;
}