From 1dd4e5be33a3d994a6ac624734c53f08c6034034 Mon Sep 17 00:00:00 2001 From: Mike Danes Date: Mon, 18 Jun 2018 21:19:08 +0300 Subject: [PATCH] Handle the missing cache case in gtGetStructHandleForSIMD Commit migrated from https://github.com/dotnet/coreclr/commit/45c04164112cccfdde71dcd79dd769013547dcaa --- src/coreclr/src/jit/compiler.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index efbf0a5..ad9a00a 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -7268,6 +7268,13 @@ private: // Get the handle for a SIMD type. CORINFO_CLASS_HANDLE gtGetStructHandleForSIMD(var_types simdType, var_types simdBaseType) { + if (m_simdHandleCache == nullptr) + { + // This may happen if the JIT generates SIMD node on its own, without importing them. + // Otherwise getBaseTypeAndSizeOfSIMDType should have created the cache. + return NO_CLASS_HANDLE; + } + if (simdBaseType == TYP_FLOAT) { switch (simdType) -- 2.7.4