Skip to content

Commit

Permalink
Fixed a bug where calling an invalid virtual function would cause a c…
Browse files Browse the repository at this point in the history
…rash.
  • Loading branch information
CandiceJoy authored and madame-rachelle committed Jan 26, 2023
1 parent 10b6d21 commit 70d355c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/common/scripting/vm/vmexec.h
Expand Up @@ -849,6 +849,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
return 0;
}
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());
reg.a[a] = p->Virtuals[C];
}
Expand Down

0 comments on commit 70d355c

Please sign in to comment.