Warn for out of bounds

This commit is contained in:
neauoire 2021-10-23 08:48:11 -07:00
parent 540fd70b9b
commit 6799b5f78e
1 changed files with 1 additions and 0 deletions

View File

@ -110,6 +110,7 @@ static void
pushbyte(Uint8 b, int lit) pushbyte(Uint8 b, int lit)
{ {
if(lit) pushbyte(findopcode("LIT"), 0); if(lit) pushbyte(findopcode("LIT"), 0);
if(p.ptr > LENGTH) fprintf(stderr, "--- Out of bounds(%04x:%02x)\n", p.ptr, b);
p.data[p.ptr++] = b; p.data[p.ptr++] = b;
p.length = p.ptr; p.length = p.ptr;
} }