mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
Fixed a bug where calling an invalid virtual function would cause a crash.
This commit is contained in:
parent
10b6d21ba2
commit
70d355cfa3
1 changed files with 1 additions and 0 deletions
|
@ -849,6 +849,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
auto p = o->GetClass();
|
auto p = o->GetClass();
|
||||||
|
if(p->Virtuals.Size() <= 0) ThrowAbortException(X_OTHER,"Attempted to call an invalid virtual function in class %s",p->TypeName.GetChars());
|
||||||
assert(C < p->Virtuals.Size());
|
assert(C < p->Virtuals.Size());
|
||||||
reg.a[a] = p->Virtuals[C];
|
reg.a[a] = p->Virtuals[C];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue