summaryrefslogtreecommitdiff
path: root/mono/tests/finalizer-exception.cs
diff options
context:
space:
mode:
Diffstat (limited to 'mono/tests/finalizer-exception.cs')
-rw-r--r--mono/tests/finalizer-exception.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/mono/tests/finalizer-exception.cs b/mono/tests/finalizer-exception.cs
index f11a1dcdef..29489ad494 100644
--- a/mono/tests/finalizer-exception.cs
+++ b/mono/tests/finalizer-exception.cs
@@ -2,10 +2,13 @@ using System;
using System.Threading;
public class FinalizerException {
+
~FinalizerException () {
throw new Exception ();
}
+ static IntPtr aptr;
+
/*
* We allocate the exception object deep down the stack so
* that it doesn't get pinned.
@@ -13,6 +16,7 @@ public class FinalizerException {
public static unsafe void MakeException (int depth) {
// Avoid tail calls
int* values = stackalloc int [20];
+ aptr = new IntPtr (values);
if (depth <= 0) {
new FinalizerException ();
return;