1
0

Fix CHKCALL

This commit is contained in:
otya128
2016-12-23 20:19:42 +09:00
parent 9df64ca072
commit 53e7138bd7
2 changed files with 12 additions and 1 deletions

View File

@@ -297,6 +297,17 @@ class VM
{ {
return backTraceStack[0..traceI]; return backTraceStack[0..traceI];
} }
bool chkcall(wstring func)
{
import otya.smilebasic.builtinfunctions;
if (func in currentSlot.functions)
return true;
if (func in BuiltinFunction.builtinFunctions)
return true;
if (func in commonFunctions)
return true;
return false;
}
} }
enum CodeType enum CodeType
{ {

View File

@@ -2246,7 +2246,7 @@ class BuiltinFunction
static int CHKCALL(PetitComputer p, wstring func) static int CHKCALL(PetitComputer p, wstring func)
{ {
func = func.toUpper; func = func.toUpper;
return (func in p.vm.currentSlot.functions) != null || (func in otya.smilebasic.builtinfunctions.BuiltinFunction.builtinFunctions) != null; return p.vm.chkcall(func);
} }
static int CHKLABEL(PetitComputer p, wstring label) static int CHKLABEL(PetitComputer p, wstring label)
{ {