mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 06:42:12 +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);
|
ASSERTA(a); ASSERTA(B);
|
||||||
{
|
{
|
||||||
auto o = (DObject*)reg.a[B];
|
auto o = (DObject*)reg.a[B];
|
||||||
|
if (o == nullptr)
|
||||||
|
{
|
||||||
|
ThrowAbortException(X_READ_NIL, nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
auto p = o->GetClass();
|
auto p = o->GetClass();
|
||||||
assert(C < p->Virtuals.Size());
|
assert(C < p->Virtuals.Size());
|
||||||
reg.a[a] = p->Virtuals[C];
|
reg.a[a] = p->Virtuals[C];
|
||||||
|
@ -673,7 +678,13 @@ static int Exec(VMFrameStack *stack, const VMOP *pc, VMReturn *ret, int numret)
|
||||||
OP(SCOPE):
|
OP(SCOPE):
|
||||||
{
|
{
|
||||||
ASSERTA(a); ASSERTKA(C);
|
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;
|
NEXTOP;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue