report address stack overflow errors

FossilOrigin-Name: 26aa472ace0283eec8f0471db5aef1ba67bcbdd837c7149bd1c9e966b95f24c0
This commit is contained in:
crc 2019-08-02 19:29:29 +00:00
parent 53acb9ca20
commit f0f670cc13
2 changed files with 6 additions and 1 deletions

View file

@ -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)

View file

@ -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.