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

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJb Evain <jbevain@gmail.com>2015-04-28 15:18:24 +0300
committerJb Evain <jbevain@gmail.com>2015-04-28 15:47:15 +0300
commit4ff484b061eb1a1b77284eb9f8c90ddcb6e05dae (patch)
treed2ee4b09e33c80c8d700d7803641949c69a0273e
parent717b17c577a7b2f197f5b2159647e194cede0812 (diff)
The arg0 for value types is a managed pointer
-rw-r--r--Mono.Cecil.Cil/MethodBody.cs2
-rw-r--r--Test/Mono.Cecil.Tests/MethodBodyTests.cs8
2 files changed, 5 insertions, 5 deletions
diff --git a/Mono.Cecil.Cil/MethodBody.cs b/Mono.Cecil.Cil/MethodBody.cs
index 31767dd..1c8768c 100644
--- a/Mono.Cecil.Cil/MethodBody.cs
+++ b/Mono.Cecil.Cil/MethodBody.cs
@@ -97,7 +97,7 @@ namespace Mono.Cecil.Cil {
{
var declaring_type = method.DeclaringType;
var type = declaring_type.IsValueType || declaring_type.IsPrimitive
- ? new PointerType (declaring_type)
+ ? new ByReferenceType (declaring_type)
: declaring_type as TypeReference;
return new ParameterDefinition (type, method);
diff --git a/Test/Mono.Cecil.Tests/MethodBodyTests.cs b/Test/Mono.Cecil.Tests/MethodBodyTests.cs
index 96f9e7a..2fc030e 100644
--- a/Test/Mono.Cecil.Tests/MethodBodyTests.cs
+++ b/Test/Mono.Cecil.Tests/MethodBodyTests.cs
@@ -236,9 +236,9 @@ namespace Mono.Cecil.Tests {
Assert.IsNotNull (int_to_string);
var this_parameter_type = int_to_string.Body.ThisParameter.ParameterType;
- Assert.IsTrue (this_parameter_type.IsPointer);
+ Assert.IsTrue (this_parameter_type.IsByReference);
- var element_type = ((PointerType) this_parameter_type).ElementType;
+ var element_type = ((ByReferenceType) this_parameter_type).ElementType;
Assert.AreEqual (int32, element_type);
}
@@ -250,9 +250,9 @@ namespace Mono.Cecil.Tests {
Assert.IsNotNull (token_to_string);
var this_parameter_type = token_to_string.Body.ThisParameter.ParameterType;
- Assert.IsTrue (this_parameter_type.IsPointer);
+ Assert.IsTrue (this_parameter_type.IsByReference);
- var element_type = ((PointerType) this_parameter_type).ElementType;
+ var element_type = ((ByReferenceType) this_parameter_type).ElementType;
Assert.AreEqual (token, element_type);
}