Permalink
Browse files

2002-05-15 Dietmar Maurer <dietmar@ximian.com>

	* delegate.c (arch_end_invoke): fix bug #24653

svn path=/trunk/mono/; revision=4649
  • Loading branch information...
Dietmar Maurer
Dietmar Maurer committed May 15, 2002
1 parent adfcff5 commit 087a3ce0fcdf033bbb552a3b99eb3ef44c73e75c
Showing with 33 additions and 5 deletions.
  1. +2 −0 mono/jit/ChangeLog
  2. +6 −5 mono/jit/delegate.c
  3. +1 −0 mono/tests/Makefile.am
  4. +24 −0 mono/tests/delegate5.cs
View
@@ -1,5 +1,7 @@
2002-05-15 Dietmar Maurer <dietmar@ximian.com>
+ * delegate.c (arch_end_invoke): fix bug #24653
+
* jit.c (mono_analyze_flow): try blocks are followed by handler
blocks, so we need to add all handler blocks as succesors.
(mono_thread_start_cb): set end_of_stack
View
@@ -87,11 +87,10 @@ mono_async_invoke (MonoAsyncResult *ares, gboolean cb_only)
{
ASyncCall *ac = (ASyncCall *)ares->data;
- if (!cb_only) {
+ if (!cb_only)
ac->res = mono_message_invoke (ares->async_delegate, ac->msg,
&ac->msg->exc, &ac->out_args);
- g_assert (ac->res);
- }
+
ac->inside_cb = 1;
ares->completed = 1;
@@ -213,8 +212,10 @@ arch_end_invoke (MonoMethod *method, gpointer first_arg, ...)
}
/* restore return value */
- g_assert (ac->res);
- arch_method_return_message_restore (method, &first_arg, ac->res, ac->out_args);
+ if (method->signature->ret->type != MONO_TYPE_VOID) {
+ g_assert (ac->res);
+ arch_method_return_message_restore (method, &first_arg, ac->res, ac->out_args);
+ }
}
gpointer
View
@@ -91,6 +91,7 @@ TESTSRC= \
delegate2.cs \
delegate3.cs \
delegate4.cs \
+ delegate5.cs \
remoting1.cs \
remoting2.cs \
remoting3.cs \
View
@@ -0,0 +1,24 @@
+using System;
+using System.Threading;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Messaging;
+
+public class T21
+{
+ public delegate void TestCallback (int i);
+
+ public static void Test (int i)
+ {
+ Console.WriteLine (i);
+ }
+
+ public static void Main ()
+ {
+ TestCallback cb = new TestCallback (Test);
+ IAsyncResult ar = cb.BeginInvoke (100, null, null);
+ ar.AsyncWaitHandle.WaitOne ();
+ cb.EndInvoke (ar);
+ }
+}
+
+

0 comments on commit 087a3ce

Please sign in to comment.