fixed sq_resume

sq_resume crashes (ci is null) when called on a dead generator.
This commit is contained in:
TobiasBohnen
2023-04-13 22:41:04 +02:00
committed by GitHub
parent 43370e97db
commit 6ea6cff922

View File

@ -715,7 +715,13 @@ bool SQVM::Execute(SQObjectPtr &closure, SQInteger nargs, SQInteger stackbase,SQ
ci->_root = SQTrue;
}
break;
case ET_RESUME_GENERATOR: _generator(closure)->Resume(this, outres); ci->_root = SQTrue; traps += ci->_etraps; break;
case ET_RESUME_GENERATOR:
if(!_generator(closure)->Resume(this, outres)) {
return false;
}
ci->_root = SQTrue;
traps += ci->_etraps;
break;
case ET_RESUME_VM:
case ET_RESUME_THROW_VM:
traps = _suspended_traps;