Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-08-19 16:41:09 +0300
committerGitHub <noreply@github.com>2021-08-19 16:41:09 +0300
commitf41fc8b1333ac74e21e31ffdfa56281e7b20816e (patch)
treef280ea75487f70a6d05f40c3dfaf271e30f8e93f
parent8b6809243db21a9ab3e2c21570958ab9c537ce29 (diff)
Adding null check to avoid abort when invalid IL is encountered (#21195)mono-6.12.0.149
When a callvirt instruction is encountered on a static method, there is a hard abort/crash. This commit avoids the problem. Co-authored-by: Bill Holmes <bill.holmes@unity3d.com>
-rw-r--r--mono/mini/method-to-ir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c
index a2639dc7431..056e8776400 100644
--- a/mono/mini/method-to-ir.c
+++ b/mono/mini/method-to-ir.c
@@ -7222,7 +7222,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
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, FALSE, error);