fixed regression in sq_resume

This commit is contained in:
albertodemichelis 2016-01-26 00:02:39 +08:00
parent 887f121555
commit b14fc118c0

View File

@ -1137,10 +1137,10 @@ SQRESULT sq_reservestack(HSQUIRRELVM v,SQInteger nsize)
SQRESULT sq_resume(HSQUIRRELVM v,SQBool retval,SQBool raiseerror)
{
SQObjectPtr &obj = v->GetUp(-1);
if(type(obj)==OT_GENERATOR){
if (type(v->GetUp(-1)) == OT_GENERATOR)
{
v->PushNull(); //retval
if(!v->Execute(v->GetUp(-2),0,v->_top,obj,raiseerror,SQVM::ET_RESUME_GENERATOR))
if (!v->Execute(v->GetUp(-2), 0, v->_top, v->GetUp(-1), raiseerror, SQVM::ET_RESUME_GENERATOR))
{v->Raise_Error(v->_lasterror); return SQ_ERROR;}
if(!retval)
v->Pop();