0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-28 08:43:02 +00:00

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; Uint8 instr;
u->ram.ptr = vec; u->ram.ptr = vec;
if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
while(u->ram.ptr) { while(u->ram.ptr) {
instr = u->ram.dat[u->ram.ptr++]; instr = u->ram.dat[u->ram.ptr++];
switch(instr) { switch(instr) {

View file

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

View file

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

View file

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