mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- added missing null pointer checks to VM ops
This commit is contained in:
parent
79b3c41677
commit
b2697a99f8
1 changed files with 12 additions and 1 deletions
|
@ -665,6 +665,11 @@ static int Exec(VMFrameStack *stack, const VMOP *pc, VMReturn *ret, int numret)
|
|||
ASSERTA(a); ASSERTA(B);
|
||||
{
|
||||
auto o = (DObject*)reg.a[B];
|
||||
if (o == nullptr)
|
||||
{
|
||||
ThrowAbortException(X_READ_NIL, nullptr);
|
||||
return 0;
|
||||
}
|
||||
auto p = o->GetClass();
|
||||
assert(C < p->Virtuals.Size());
|
||||
reg.a[a] = p->Virtuals[C];
|
||||
|
@ -673,7 +678,13 @@ static int Exec(VMFrameStack *stack, const VMOP *pc, VMReturn *ret, int numret)
|
|||
OP(SCOPE):
|
||||
{
|
||||
ASSERTA(a); ASSERTKA(C);
|
||||
FScopeBarrier::ValidateCall(((DObject*)reg.a[a])->GetClass(), (VMFunction*)konsta[C].v, B - 1);
|
||||
auto o = (DObject*)reg.a[a];
|
||||
if (o == nullptr)
|
||||
{
|
||||
ThrowAbortException(X_READ_NIL, nullptr);
|
||||
return 0;
|
||||
}
|
||||
FScopeBarrier::ValidateCall(o->GetClass(), (VMFunction*)konsta[C].v, B - 1);
|
||||
}
|
||||
NEXTOP;
|
||||
|
||||
|
|
Loading…
Reference in a new issue