Index: ossp-pkg/ex/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/ex/ChangeLog,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/ex/ChangeLog,v' 2>/dev/null --- ChangeLog 2003/01/30 10:23:12 1.5 +++ ChangeLog 2003/01/30 10:59:34 1.6 @@ -16,6 +16,9 @@ *) Polished and enhanced the manual page ex(3). [Ralf S. Engelschall] + *) Fixed the implementation of the ex_cleanup clause. + [A Makarov ] + Changes between 1.0.0 and 1.0.1 (08-Mar-2002 to 06-Jan-2003) *) Adjusted copyright messages to include new year 2003. Index: ossp-pkg/ex/ex.h RCS File: /v/ossp/cvs/ossp-pkg/ex/ex.h,v rcsdiff -q -kk '-r1.19' '-r1.20' -u '/v/ossp/cvs/ossp-pkg/ex/ex.h,v' 2>/dev/null --- ex.h 2003/01/06 15:31:24 1.19 +++ ex.h 2003/01/30 10:59:34 1.20 @@ -100,13 +100,12 @@ int ctx_shielding;/* permanent counter of exception shielding level */ int ctx_shield; /* temporary flag for exception shielding macro */ int ctx_caught; /* temporary flag whether exception was caught */ - int ctx_cleanup; /* temporary flag whether cleanup block was present */ volatile ex_t ctx_ex; /* temporary exception storage */ } ex_ctx_t; /* the static and dynamic initializers for a context structure */ #define EX_CTX_INITIALIZER \ - { NULL, 0, 0, 0, 0, 0, 0, 0, { NULL, NULL, NULL, NULL, 0, NULL } } + { NULL, 0, 0, 0, 0, 0, 0, { NULL, NULL, NULL, NULL, 0, NULL } } #define EX_CTX_INITIALIZE(ctx) \ do { \ (ctx)->ctx_mctx = NULL; \ @@ -116,7 +115,6 @@ (ctx)->ctx_shielding = 0; \ (ctx)->ctx_shield = 0; \ (ctx)->ctx_caught = 0; \ - (ctx)->ctx_cleanup = 0; \ (ctx)->ctx_ex.ex_class = NULL; \ (ctx)->ctx_ex.ex_object = NULL; \ (ctx)->ctx_ex.ex_value = NULL; \ @@ -139,11 +137,11 @@ #define ex_try \ { \ ex_ctx_t *__ex_ctx_ptr = __ex_ctx(); \ + int __ex_cleanup = 0; \ __ex_mctx_t *__ex_mctx_en; \ __ex_mctx_t __ex_mctx_me; \ __ex_mctx_en = __ex_ctx_ptr->ctx_mctx; \ __ex_ctx_ptr->ctx_mctx = &__ex_mctx_me; \ - __ex_ctx_ptr->ctx_cleanup = 0; \ if (__ex_mctx_save(&__ex_mctx_me)) { \ if (1) @@ -158,7 +156,7 @@ __ex_ctx_ptr->ctx_caught = 1; \ } \ __ex_ctx_ptr->ctx_mctx = __ex_mctx_en; \ - __ex_ctx()->ctx_cleanup = 1; \ + __ex_cleanup = 1; \ if (1) { \ if (1) @@ -166,11 +164,11 @@ #define ex_catch(e) \ else { \ } \ - if (!(__ex_ctx()->ctx_cleanup)) \ + if (!(__ex_cleanup)) \ __ex_ctx_ptr->ctx_caught = 0; \ } \ else { \ - if (!(__ex_ctx()->ctx_cleanup)) { \ + if (!(__ex_cleanup)) { \ __ex_mctx_restored(&__ex_mctx_me); \ __ex_ctx_ptr->ctx_caught = 1; \ } \