When a callvirt instruction is encountered on a static method, there is
a hard abort/crash. This commit avoids the problem.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bill Holmes <bill.holmes@unity3d.com>
sp -= n;
- if (virtual_ && cmethod && sp [0]->opcode == OP_TYPED_OBJREF) {
+ if (virtual_ && cmethod && sp [0] && sp [0]->opcode == OP_TYPED_OBJREF) {
ERROR_DECL (error);
MonoMethod *new_cmethod = mono_class_get_virtual_method (sp [0]->klass, cmethod, error);