1
0
This commit is contained in:
otya128
2017-07-23 19:13:43 +09:00
parent c235687096
commit 3eae20517a
3 changed files with 17 additions and 1 deletions

View File

@@ -744,6 +744,11 @@ class PopG : Code
vm.currentSlot.global[var] = Value(cast(int)v.doubleValue); vm.currentSlot.global[var] = Value(cast(int)v.doubleValue);
return; return;
} }
if (g.isNonStringArray && v.isNonStringArray)
{
vm.currentSlot.global[var] = v;
return;
}
if(g.type == ValueType.Void) if(g.type == ValueType.Void)
{ {
vm.currentSlot.global[var] = v; vm.currentSlot.global[var] = v;
@@ -816,6 +821,11 @@ class PopL : Code
vm.stack[vm.bp + var] = Value(cast(int)v.doubleValue); vm.stack[vm.bp + var] = Value(cast(int)v.doubleValue);
return; return;
} }
if (g.isNonStringArray && v.isNonStringArray)
{
vm.stack[vm.bp + var] = v;
return;
}
if(g.type == ValueType.Void) if(g.type == ValueType.Void)
{ {
vm.stack[vm.bp + var] = v; vm.stack[vm.bp + var] = v;

View File

@@ -1330,7 +1330,8 @@ class PetitComputer
for(int i = 0; !quit && maincntRender == oldmaincnt && !waitFlag && running; i++) for(int i = 0; !quit && maincntRender == oldmaincnt && !waitFlag && running; i++)
{ {
version (traceVM) version (traceVM)
std.stdio.stderr.writefln("%04X:%s", vm.pc, vm.getCurrent.toString(vm)); if (vm.pc < vm.currentSlot.code.length)
std.stdio.stderr.writefln("%04X:%s", vm.pc, vm.getCurrent.toString(vm));
version (dumpStackVM) version (dumpStackVM)
vm.dumpStack(); vm.dumpStack();
auto b = vm.runStep(); auto b = vm.runStep();

View File

@@ -184,6 +184,11 @@ struct Value
return this.type == ValueType.IntegerArray || this.type == ValueType.DoubleArray || return this.type == ValueType.IntegerArray || this.type == ValueType.DoubleArray ||
this.type == ValueType.StringArray || this.type == ValueType.String; this.type == ValueType.StringArray || this.type == ValueType.String;
} }
bool isNonStringArray()
{
return this.type == ValueType.IntegerArray || this.type == ValueType.DoubleArray ||
this.type == ValueType.StringArray;
}
bool isNumberArray() bool isNumberArray()
{ {
return this.type == ValueType.IntegerArray || this.type == ValueType.DoubleArray; return this.type == ValueType.IntegerArray || this.type == ValueType.DoubleArray;