diff options
author | Jan Kotas <jkotas@microsoft.com> | 2019-05-28 18:38:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-28 18:38:42 -0700 |
commit | 02e75ab55272902aed4c2501ab7c6740bae30485 (patch) | |
tree | 60f3f23a98e6cd757dcb93f0b000598f77e66eef | |
parent | 7f9e1aef945a2115b337688976fa1c4cfebe1825 (diff) | |
download | coreclr-02e75ab55272902aed4c2501ab7c6740bae30485.tar.gz coreclr-02e75ab55272902aed4c2501ab7c6740bae30485.tar.bz2 coreclr-02e75ab55272902aed4c2501ab7c6740bae30485.zip |
Add null checks before calling ClassLoader::EnsureLoaded (#24818)
Fixes #24816
-rw-r--r-- | src/vm/fieldmarshaler.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vm/fieldmarshaler.h b/src/vm/fieldmarshaler.h index 1718bd3b7b..7041cf1bdf 100644 --- a/src/vm/fieldmarshaler.h +++ b/src/vm/fieldmarshaler.h @@ -447,7 +447,9 @@ protected: Module::RestoreMethodTablePointer(ppMT); #else // FEATURE_PREJIT // without NGEN we only have to make sure that the type is fully loaded - ClassLoader::EnsureLoaded(ppMT->GetValue()); + MethodTable* pMT = ppMT->GetValue(); + if (pMT != NULL) + ClassLoader::EnsureLoaded(pMT); #endif // FEATURE_PREJIT } @@ -1094,7 +1096,9 @@ public: Module::RestoreTypeHandlePointer(&m_arrayType); #else // FEATURE_PREJIT // without NGEN we only have to make sure that the type is fully loaded - ClassLoader::EnsureLoaded(m_arrayType.GetValue()); + TypeHandle th = m_arrayType.GetValue(); + if (!th.IsNull()) + ClassLoader::EnsureLoaded(th); #endif // FEATURE_PREJIT FieldMarshaler::RestoreImpl(); } |