From e7d260afa524de441e119e8275bc54b38c6600c8 Mon Sep 17 00:00:00 2001 From: "Steve MacLean, Qualcomm Datacenter Technologies, Inc" Date: Fri, 17 Mar 2017 00:01:21 +0000 Subject: Allow target of calli to be lowered to ldc.i4 --- src/jit/importer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 11e1d470bb..f2a4d21d5d 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -5658,7 +5658,11 @@ GenTreeCall* Compiler::impImportIndirectCall(CORINFO_SIG_INFO* sig, IL_OFFSETX i /* Get the function pointer */ GenTreePtr fptr = impPopStack().val; - assert(genActualType(fptr->gtType) == TYP_I_IMPL); + + // The function pointer is typically a sized to match the target pointer size + // However, stubgen IL optimization can change LDC.I8 to LDC.I4 + // See ILCodeStream::LowerOpcode + assert(genActualType(fptr->gtType) == TYP_I_IMPL || genActualType(fptr->gtType) == TYP_INT); #ifdef DEBUG // This temporary must never be converted to a double in stress mode, -- cgit v1.2.3