Created working stack space in case of previous evaluxn overflow

This commit is contained in:
Andrew Alderwick 2021-07-14 20:19:29 +01:00
parent 742c52265f
commit 4622a8a061
4 changed files with 4 additions and 0 deletions

View File

@ -324,6 +324,7 @@ evaluxn(Uxn *u, Uint16 vec)
{
Uint8 instr;
u->ram.ptr = vec;
if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
while(u->ram.ptr) {
instr = u->ram.dat[u->ram.ptr++];
switch(instr) {

View File

@ -232,6 +232,7 @@ evaluxn(Uxn *u, Uint16 vec)
{
Uint8 instr;
u->ram.ptr = vec;
if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
while(u->ram.ptr) {
instr = u->ram.dat[u->ram.ptr++];
switch(instr) {

View File

@ -56,6 +56,7 @@ evaluxn(Uxn *u, Uint16 vec)
{
Uint8 instr;
u->ram.ptr = vec;
if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
while(u->ram.ptr) {
instr = u->ram.dat[u->ram.ptr++];
switch(instr) {

View File

@ -159,6 +159,7 @@ evaluxn(Uxn *u, Uint16 vec)
u->ram.ptr = vec;
u->wst.error = 0;
u->rst.error = 0;
if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
while(u->ram.ptr)
if(!stepuxn(u, u->ram.dat[u->ram.ptr++]))
return 0;