diff --git a/src/ILCompiler.Compiler/src/CppCodeGen/ILToCppImporter.cs b/src/ILCompiler.Compiler/src/CppCodeGen/ILToCppImporter.cs index 03133ce936e..3c6f7e8ef89 100644 --- a/src/ILCompiler.Compiler/src/CppCodeGen/ILToCppImporter.cs +++ b/src/ILCompiler.Compiler/src/CppCodeGen/ILToCppImporter.cs @@ -1944,6 +1944,7 @@ private void ImportLoadIndirect(TypeDesc type) PushTemp(GetStackValueKind(type), type); + AppendCastIfNecessary(GetStackValueKind(type), type); Append("*("); Append(_writer.GetCppSignatureTypeName(type)); Append("*)");