Browse Source

2004-04-18 Zoltan Varga <[email protected]>

	* exceptions.cs (test_0_rethow_stacktrace): Make this work with
	inlining.

svn path=/trunk/mono/; revision=25668
Zoltan Varga 22 years ago
parent
commit
a11233a5bf
2 changed files with 14 additions and 6 deletions
  1. 5 0
      mono/mini/ChangeLog
  2. 9 6
      mono/mini/exceptions.cs

+ 5 - 0
mono/mini/ChangeLog

@@ -1,3 +1,8 @@
+2004-04-18  Zoltan Varga  <[email protected]>
+
+	* exceptions.cs (test_0_rethow_stacktrace): Make this work with
+	inlining.
+
 2004-04-18 Ben Maurer  <[email protected]>
 
 	* iltests.il, basic.cs: more tests for regalloc.

+ 9 - 6
mono/mini/exceptions.cs

@@ -1858,19 +1858,22 @@ class Tests {
 		return i;
 	}
 
-	static void rethrow1 () {
-		throw new Exception ();
-	}
+	/* MarshalByRefObject prevents the methods from being inlined */
+	class ThrowClass : MarshalByRefObject {
+		public static void rethrow1 () {
+			throw new Exception ();
+		}
 
-	static void rethrow2 () {
-		rethrow1 ();
+		public static void rethrow2 () {
+			rethrow1 ();
+		}
 	}
 
 	static int test_0_rethrow_stacktrace () {
 		// Check that rethrowing an exception preserves the original stack trace
 		try {
 			try {
-				rethrow2 ();
+				ThrowClass.rethrow2 ();
 			}
 			catch (Exception ex) {
 				throw;