Browse code

Re-added the stack bounds clamp

neauoire authored on 05/08/2021 03:14:53
Showing 4 changed files
... ...
@@ -322,6 +322,7 @@ uxn_eval(Uxn *u, Uint16 vec)
322 322
 	if(u->dev[0].dat[0xf]) 
323 323
 		return 0;
324 324
 	u->ram.ptr = vec;
325
+  if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
325 326
 	while(u->ram.ptr) {
326 327
 		instr = u->ram.dat[u->ram.ptr++];
327 328
 		switch(instr) {
... ...
@@ -231,6 +231,7 @@ uxn_eval(Uxn *u, Uint16 vec)
231 231
 	if(u->dev[0].dat[0xf]) 
232 232
 		return 0;
233 233
 	u->ram.ptr = vec;
234
+	if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
234 235
 	while(u->ram.ptr) {
235 236
 		instr = u->ram.dat[u->ram.ptr++];
236 237
 		switch(instr) {
... ...
@@ -45,6 +45,7 @@ uxn_eval(Uxn *u, Uint16 vec)
45 45
 	if(u->dev[0].dat[0xf]) 
46 46
 		return 0;
47 47
 	u->ram.ptr = vec;
48
+	if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
48 49
 	while(u->ram.ptr) {
49 50
 		instr = u->ram.dat[u->ram.ptr++];
50 51
 		switch(instr) {
... ...
@@ -125,6 +125,7 @@ uxn_eval(Uxn *u, Uint16 vec)
125 125
 	if(u->dev[0].dat[0xf])
126 126
 		return 0;
127 127
 	u->ram.ptr = vec;
128
+	if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8;
128 129
 	while(u->ram.ptr) {
129 130
 		Uint8 instr = u->ram.dat[u->ram.ptr++];
130 131
 		/* Return Mode */