Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2018-07-03 06:17:24 +0300
committerJan Kotas <jkotas@microsoft.com>2018-07-03 06:17:24 +0300
commitd511215822ff90298d1e1b7b9cd58c0197d54fbe (patch)
treebbf56096f75946ee661f3b896fcdeeda701de6c2 /src/ILCompiler.CppCodeGen
parent2152ccc2c599768663281aa67cb2155f1610f248 (diff)
Fix stack slot kind for ByReference.get_Value in CppCodegen (#6034)
* Fix stack slot kind for ByReference.get_Value in CppCodegen This should be tracked as a ByRef. This was the reason why the compiler was considering `MemoryMarshal.GetNonNullPinnableReference` invalid IL and we were generating a throwing body for it. * Include cast
Diffstat (limited to 'src/ILCompiler.CppCodeGen')
-rw-r--r--src/ILCompiler.CppCodeGen/src/CppCodeGen/ILToCppImporter.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ILCompiler.CppCodeGen/src/CppCodeGen/ILToCppImporter.cs b/src/ILCompiler.CppCodeGen/src/CppCodeGen/ILToCppImporter.cs
index 92ac97902..33ab17d76 100644
--- a/src/ILCompiler.CppCodeGen/src/CppCodeGen/ILToCppImporter.cs
+++ b/src/ILCompiler.CppCodeGen/src/CppCodeGen/ILToCppImporter.cs
@@ -1003,8 +1003,9 @@ namespace Internal.IL
if (IsTypeName(method, "System", "ByReference`1"))
{
var thisRef = _stack.Pop();
-
- PushExpression(StackValueKind.ValueType, ((ExpressionEntry)thisRef).Name + "->_value", method.Signature.ReturnType);
+ PushExpression(StackValueKind.ByRef,
+ String.Concat("(", GetSignatureTypeNameAndAddReference(method.Signature.ReturnType), ")", ((ExpressionEntry)thisRef).Name, "->_value"),
+ method.Signature.ReturnType);
return true;
}
break;