1
0

バグ修正

This commit is contained in:
otya128
2015-06-05 22:29:37 +09:00
parent 790d9a1873
commit 88ad0392a1
4 changed files with 28 additions and 4 deletions

View File

@@ -12,11 +12,13 @@ class VM
int pc;
Value[] stack;
Value[] global;
this(Code[] code, int len)
int[wstring] debugTable;
this(Code[] code, int len, int[wstring] debugTable)
{
this.code = code;
this.stack = new Value[1024 * 1024];
this.global = new Value[len];
this.debugTable = debugTable;
}
void run()
{
@@ -33,6 +35,10 @@ class VM
{
value = stack[--stacki];
}
Value testGetGlobaVariable(wstring name)
{
return global[debugTable[name]];
}
}
enum CodeType
{
@@ -134,8 +140,8 @@ class Operate : Code
{
Value l;
Value r;
vm.pop(l);
vm.pop(r);
vm.pop(l);
double ld = l.integerValue;
double rd = r.integerValue;
//とりあえずInteger
@@ -154,6 +160,7 @@ class Operate : Code
ld /= rd;
break;
default:
writeln("NotImpl: ", operator);
break;
}
l.integerValue = cast(int)ld;