rre, repl: quit if attempt to store before address 0

FossilOrigin-Name: ce61c9c18e464240e22f68b50fe17474ef089a67143e4c3d3b615b83baae42f7
This commit is contained in:
crc 2017-11-21 12:20:55 +00:00
parent ec4e406feb
commit 777b15e56a
2 changed files with 2 additions and 2 deletions

View file

@ -443,7 +443,7 @@ void inst_fetch() {
}
void inst_store() {
if (TOS <= IMAGE_SIZE) {
if (TOS <= IMAGE_SIZE && TOS >= 0) {
memory[TOS] = NOS;
inst_drop();
inst_drop();

View file

@ -978,7 +978,7 @@ void inst_fetch() {
}
void inst_store() {
if (TOS <= IMAGE_SIZE) {
if (TOS <= IMAGE_SIZE && TOS >= 0) {
memory[TOS] = NOS;
inst_drop();
inst_drop();