Skip to content

Instantly share code, notes, and snippets.

@radical
Created April 21, 2018 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radical/26d9b11e185353ea4f869ce3fbeaf61a to your computer and use it in GitHub Desktop.
Save radical/26d9b11e185353ea4f869ce3fbeaf61a to your computer and use it in GitHub Desktop.
diff --git a/mono/tests/exception20.cs b/mono/tests/exception20.cs
index 3337a7fe294..37ce9bfc9d7 100644
--- a/mono/tests/exception20.cs
+++ b/mono/tests/exception20.cs
@@ -13,12 +13,21 @@ class C
{
static CustomException e;
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static void ThrowCustomException ()
+ {
+ throw new CustomException(1);
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
static void Throw ()
{
try {
- throw new CustomException(1);
+ ThrowCustomException ();
} catch (CustomException ex) {
e = ex;
+ // so, the original exception has two frames
+ CheckTrace (e, 2);
}
}
@@ -76,6 +85,8 @@ class C
// Single frame
// Filter returns false
+ // Original exception @e had two frames, but after throwing here it
+ // should have just 1
try {
throw e;
} catch (Exception ex) when (CheckTrace (ex, 1, true)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment