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
path: root/mono
diff options
context:
space:
mode:
authorBill Holmes <bill.holmes@unity3d.com>2021-08-19 16:29:39 +0300
committerGitHub <noreply@github.com>2021-08-19 16:29:39 +0300
commite58be44d4729c237d0b148f63daf9dd78c0d1bd5 (patch)
tree54180612ca80c1f32419c767c81a7e06c50db4e2 /mono
parent20956cb3d84df213da894436630585691fe01630 (diff)
Adding null check to avoid abort when invalid IL is encountered (#21194)
When a callvirt instruction is encountered on a static method, there is a hard abort/crash. This commit avoids the problem.
Diffstat (limited to 'mono')
-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 068e0bbf9af..aec34bf2000 100644
--- a/mono/mini/method-to-ir.c
+++ b/mono/mini/method-to-ir.c
@@ -7458,7 +7458,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);