From ba2e8265c99bc31c9d1eb8829c4b63d7e2ccf3f4 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Mon, 27 Apr 2020 17:20:46 +0100 Subject: Fix try in exception handler jib bug The have_exception flag wasn't being cleared until after the handler, resulting in false exception reporting. --- test/c/exception.expect | 2 ++ test/c/exception.sail | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/c/exception.expect b/test/c/exception.expect index 79d97c6a..faab808f 100644 --- a/test/c/exception.expect +++ b/test/c/exception.expect @@ -4,3 +4,5 @@ Caught Estring test 2nd try Caught Epair x = 33 +in g() +Fall through OK diff --git a/test/c/exception.sail b/test/c/exception.sail index 4e74fcae..251852c9 100644 --- a/test/c/exception.sail +++ b/test/c/exception.sail @@ -47,6 +47,19 @@ function main () = { }, _ => () }; + try throw(Eunknown()) catch { + _ => try let _ = g() in () catch { + _ => print("caught old exception") + } + }; + try + try throw Eunknown() catch { + Estring(_) => () + } + catch { + Eunknown() => print("Fall through OK"), + _ => () + }; f(); () -} \ No newline at end of file +} -- cgit v1.2.3