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:
authorJan Kotas <jkotas@microsoft.com>2015-10-26 21:42:30 +0300
committerJan Kotas <jkotas@microsoft.com>2015-10-26 21:42:30 +0300
commit83b431e7bea124c288c64b39ce93985205f8bae2 (patch)
tree0812657004af5c7463d52ba5d2be663bad368724 /src/JitInterface
parent97c0421a41288e4aa369bf6da4726c89dc0279d0 (diff)
parent69bc9908acfb501c8e32f798355f111637a1dc54 (diff)
Merge pull request #125 from MichalStrehovsky/fix-116
Redirect string constructor references to the Ctor method
Diffstat (limited to 'src/JitInterface')
-rw-r--r--src/JitInterface/src/CorInfoImpl.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/JitInterface/src/CorInfoImpl.cs b/src/JitInterface/src/CorInfoImpl.cs
index 6e61589b1..94e714d81 100644
--- a/src/JitInterface/src/CorInfoImpl.cs
+++ b/src/JitInterface/src/CorInfoImpl.cs
@@ -1542,8 +1542,16 @@ namespace Internal.JitInterface
}
else
{
- _compilation.AddMethod(method);
- pResult.codePointerOrStubLookup.constLookup.addr = pResolvedToken.hMethod;
+ if (method.IsConstructor && method.OwningType.IsString)
+ {
+ // Calling a string constructor doesn't call the actual constructor.
+ var initMethod = IntrinsicMethods.GetStringInitializer(method);
+ pResult.codePointerOrStubLookup.constLookup.addr = ObjectToHandle(initMethod);
+ }
+ else
+ {
+ pResult.codePointerOrStubLookup.constLookup.addr = pResolvedToken.hMethod;
+ }
}