Lo stack non può andare sotto zero
This commit is contained in:
parent
6746d96fd4
commit
16c84948c2
@ -617,6 +617,10 @@ bool VM::execPOOP(void) {
|
||||
|
||||
dst = as.code[regs[IP] + 1];
|
||||
DBG_INFO(("POOP %s\n", getRegName(dst)));
|
||||
if (regs[SP] - sizeof(uint16_t) < 0) {
|
||||
DBG_ERROR(("Stack is going below 0!\n"));
|
||||
return false;
|
||||
}
|
||||
regs[SP] -= sizeof(uint16_t);
|
||||
memcpy(®s[dst], &as.stack[regs[SP]], sizeof(uint16_t));
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user