diff options
author | Zoltan Varga <vargaz@gmail.com> | 2017-06-10 06:53:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-10 06:53:39 +0300 |
commit | 60d58d9128334a4aee72ed3a38d21177a12d8f10 (patch) | |
tree | a3c85f259edcfc76ce6921f00c6078253a733caa /mcs/class | |
parent | f8a969aae9cce2ca78795dd29e97f347d129a82b (diff) |
[sdb] Fix passing of nullable parameters in invokes. Fixes #57160. (#5012)
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs | 8 | ||||
-rw-r--r-- | mcs/class/Mono.Debugger.Soft/Test/dtest.cs | 12 |
2 files changed, 20 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 400b43ce34f..d2b408a68ed 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs @@ -1165,10 +1165,18 @@ public class Tests : TestsBase, ITest2 return 42; } + public int invoke_pass_nullable (int? i) { + return (int)i; + } + public int? invoke_return_nullable_null () { return null; } + public int invoke_pass_nullable_null (int? i) { + return i.HasValue ? 1 : 2; + } + public void invoke_type_load () { new Class3 (); } diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index 631b5985db1..5f80228fe2f 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -2617,6 +2617,11 @@ public class DebuggerTests m = s.Type.GetMethod ("ToString"); v = s.InvokeMethod (e.Thread, m, null); + // pass nullable as argument + m = t.GetMethod ("invoke_pass_nullable"); + v = this_obj.InvokeMethod (e.Thread, m, new Value [] { s }); + AssertValue (42, v); + // return nullable null m = t.GetMethod ("invoke_return_nullable_null"); v = this_obj.InvokeMethod (e.Thread, m, null); @@ -2630,6 +2635,13 @@ public class DebuggerTests m = s.Type.GetMethod ("ToString"); v = s.InvokeMethod (e.Thread, m, null); + // pass nullable null as argument + m = t.GetMethod ("invoke_pass_nullable_null"); + v = this_obj.InvokeMethod (e.Thread, m, new Value [] { s }); + AssertValue (2, v); + + return; + // pass primitive m = t.GetMethod ("invoke_pass_primitive"); Value[] args = new Value [] { |