From 848e1209a2e51d782f301b6198344396200a2ba6 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 4 May 2009 14:02:17 -0500 Subject: [PATCH] make sure call_cleanup makes exception handler fail. --- pl/utils.yap | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pl/utils.yap b/pl/utils.yap index c40b826e6..80ce9c2eb 100644 --- a/pl/utils.yap +++ b/pl/utils.yap @@ -65,8 +65,12 @@ call_cleanup(Goal, Catcher, Cleanup) :- '$cleanup_exception'(Exception, exception(Exception), Cleanup) :- !, % whatever happens, let exception go through - catch('$clean_call'(Cleanup),_,true), - throw(Exception). + ( + catch('$clean_call'(Cleanup),_,fail), + fail + ; + throw(Exception) + ). '$cleanup_exception'(Exception, _, _) :- throw(Exception).