[pure-lang-svn] SF.net SVN: pure-lang:[484] pure/trunk
Status: Beta
Brought to you by:
agraef
|
From: <ag...@us...> - 2008-08-13 13:13:13
|
Revision: 484
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=484&view=rev
Author: agraef
Date: 2008-08-13 13:13:21 +0000 (Wed, 13 Aug 2008)
Log Message:
-----------
Mask further asynchronous signals in pure_catch while invoking an exception handler.
Modified Paths:
--------------
pure/trunk/interpreter.cc
pure/trunk/interpreter.hh
pure/trunk/runtime.cc
Modified: pure/trunk/interpreter.cc
===================================================================
--- pure/trunk/interpreter.cc 2008-08-13 12:43:41 UTC (rev 483)
+++ pure/trunk/interpreter.cc 2008-08-13 13:13:21 UTC (rev 484)
@@ -21,6 +21,7 @@
int interpreter::stackmax = 0;
int interpreter::stackdir = 0;
int interpreter::brkflag = 0;
+int interpreter::brkmask = 0;
static void* resolve_external(const std::string& name)
{
Modified: pure/trunk/interpreter.hh
===================================================================
--- pure/trunk/interpreter.hh 2008-08-13 12:43:41 UTC (rev 483)
+++ pure/trunk/interpreter.hh 2008-08-13 13:13:21 UTC (rev 484)
@@ -583,7 +583,7 @@
static bool g_interactive;
static interpreter* g_interp;
// not saved
- static int brkflag;
+ static int brkflag, brkmask;
static char *baseptr;
static int stackmax;
static int stackdir;
Modified: pure/trunk/runtime.cc
===================================================================
--- pure/trunk/runtime.cc 2008-08-13 12:43:41 UTC (rev 483)
+++ pure/trunk/runtime.cc 2008-08-13 13:13:21 UTC (rev 484)
@@ -38,12 +38,15 @@
interpreter::stackdir*(&test - interpreter::baseptr) \
>= interpreter::stackmax) \
pure_throw(stack_exception())
-#define checkall(test) if (interpreter::brkflag) \
- pure_throw(signal_exception(interpreter::brkflag)); \
- else if (interpreter::stackmax > 0 && \
+#define checkall(test) if (interpreter::stackmax > 0 && \
interpreter::stackdir*(&test - interpreter::baseptr) \
- >= interpreter::stackmax) \
- pure_throw(stack_exception())
+ >= interpreter::stackmax) { \
+ interpreter::brkmask = 0; \
+ pure_throw(stack_exception()); \
+ } else if (interpreter::brkmask) \
+ interpreter::brkmask = 0; \
+ else if (interpreter::brkflag) \
+ pure_throw(signal_exception(interpreter::brkflag))
// Debug expression allocations. Warns about expression memory leaks.
// NOTE: Bookkeeping starts and ends at each toplevel pure_invoke call.
@@ -1389,6 +1392,8 @@
<< "): " << e << endl;
#endif
pure_free_internal(x);
+ // mask further breaks until the handler starts executing
+ interp.brkmask = 1;
pure_expr *res = pure_apply(h, e);
return res;
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|