diff --git a/source/interfaces/retro-unix.c b/source/interfaces/retro-unix.c index 777c5db..74b3e53 100644 --- a/source/interfaces/retro-unix.c +++ b/source/interfaces/retro-unix.c @@ -308,6 +308,11 @@ void rre_execute(CELL cell, int silent) { printf("At %d, opcode %d\n", ip, opcode); exit(1); } + if (rp < 0 || rp > ADDRESSES) { + printf("\nERROR (nga/rre_execute): Address Stack Limits Exceeded!\n"); + printf("At %d, opcode %d\n", ip, opcode); + exit(1); + } #endif ip++; if (rp == 0) diff --git a/source/retro.forth b/source/retro.forth index 7c98b91..19418b7 100644 --- a/source/retro.forth +++ b/source/retro.forth @@ -412,7 +412,7 @@ Apply q to x, y, and z. Execute quote until quote returns a flag of 0. In high level code: :while (q-) - [ repeat dup dup push call swap 0; drop again ] call drop ; + [ repeat dup push call pop swap 0; drop again ] call drop ; This is manually translated to assembly and inlined for performance.