diff options
author | Jonathan Chambers <joncham@gmail.com> | 2018-11-02 23:58:03 +0300 |
---|---|---|
committer | Ludovic Henry <luhenry@microsoft.com> | 2018-11-02 23:58:03 +0300 |
commit | 02f46d3f4930b8aef6968f519824f1e0c9387767 (patch) | |
tree | 06e1b2c8f5e8501b5b91098ccdd01d11dc6d8e2a /mcs/class/Mono.Debugger.Soft | |
parent | de2cb5fdde73393f787c87ab156bcffa09d458ee (diff) |
Fix ref return for structs in runtime invoke wrapper. (#11514)
Use mono_mb_emit_op for CEE_LDOBJ to ensure wrapper data is added for
indirect load of a ref return value as method-to-ir expects this for wrappers.
Diffstat (limited to 'mcs/class/Mono.Debugger.Soft')
-rw-r--r-- | mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs | 6 | ||||
-rw-r--r-- | mcs/class/Mono.Debugger.Soft/Test/dtest.cs | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs index c617107cafe..a217648d87b 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs @@ -1822,6 +1822,12 @@ public class Tests : TestsBase, ITest2 public static ref string get_ref_string() { return ref ref_return_string; } + + + static BlittableStruct ref_return_struct = new BlittableStruct () { i = 1, d = 2.0 }; + public static ref BlittableStruct get_ref_struct() { + return ref ref_return_struct; + } } public class SentinelClass : MarshalByRefObject { diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index 14a4524da4f..ccab651dee1 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -4667,6 +4667,14 @@ public class DebuggerTests m = t.GetMethod ("get_ref_string"); v = t.InvokeMethod (e.Thread, m, null); AssertValue ("byref", v); + + m = t.GetMethod ("get_ref_struct"); + v = t.InvokeMethod (e.Thread, m, null); + Assert.IsTrue(v is StructMirror); + + var mirror = (StructMirror)v; + AssertValue (1, mirror["i"]); + AssertValue (2.0, mirror["d"]); } } // class DebuggerTests } // namespace |