Fix error
This commit is contained in:
@@ -1560,7 +1560,15 @@ class CallBuiltinFunction : Code
|
||||
arg = vm.stack[vm.stacki - argcount..vm.stacki];
|
||||
result = vm.stack[vm.stacki/* - argcount */+ 1..vm.stacki + 1/* - argcount */+ outcount];//雑;
|
||||
}
|
||||
func.func(vm.petitcomputer, arg, result);
|
||||
try
|
||||
{
|
||||
func.func(vm.petitcomputer, arg, result);
|
||||
}
|
||||
catch (SmileBasicError sbe)
|
||||
{
|
||||
sbe.func = func.name;
|
||||
throw sbe;
|
||||
}
|
||||
if(func.variadic)
|
||||
{
|
||||
vm.stacki -= argcount;
|
||||
|
||||
@@ -10,6 +10,7 @@ class SmileBasicError : Exception
|
||||
int errline;
|
||||
int errprg;
|
||||
string message2;
|
||||
string func;
|
||||
this(int slot, int line, string message)
|
||||
{
|
||||
super(format("%s in %d:%d", message, slot, line));
|
||||
|
||||
@@ -1230,6 +1230,7 @@ class PetitComputer
|
||||
//print(sbe.to!string);
|
||||
writeln(sbe.to!string);
|
||||
writeln(sbe.getErrorMessage2);
|
||||
writeln(sbe.func);
|
||||
loc = vm.currentLocation;
|
||||
console.print(loc.line, ":", loc.pos, ":", parser.getLine(loc));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user