From 9fd31c9c526577b1ab344a026b98f913bc20ba29 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 21 Oct 2024 01:19:53 +0900 Subject: [PATCH] fixed a bug of not setting the exception variable position in compile_catch() --- lib/comp.c | 3 ++- lib/gc.c | 2 +- lib/utl.c | 3 ++- src/kernel.hcl | 28 +++++++++++----------------- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/lib/comp.c b/lib/comp.c index 2cb4f13..deb0dbc 100644 --- a/lib/comp.c +++ b/lib/comp.c @@ -4299,7 +4299,8 @@ static HCL_INLINE int compile_catch (hcl_t* hcl) } /* add the exception variable to the local variable list. increase the number of local variables */ - exarg_offset = hcl->c->tv.s.len + 1; /* when the variable name is added, its offset will be the current length + 1 for a space character added */ + exarg_offset = hcl->c->tv.s.len; + if (hcl->c->tv.s.len > 0) exarg_offset++; /* if the variable is not the first, add 1 for a preceding space */ if (hcl->c->funblk.depth > 0) { diff --git a/lib/gc.c b/lib/gc.c index bcd79cc..9befe88 100644 --- a/lib/gc.c +++ b/lib/gc.c @@ -662,7 +662,7 @@ static kernel_class_info_t kernel_classes[__KCI_MAX__] = KCI(KCI_SYSTEM) { "System", - KCI_OBJECT, + KCI_APEX, 0, 0, 5, /* asyncsg, gcfin_sem, gcfin_should_exit, ossig_pid, shr */ diff --git a/lib/utl.c b/lib/utl.c index 52af694..fa7f079 100644 --- a/lib/utl.c +++ b/lib/utl.c @@ -22,7 +22,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "hcl-prv.h" +#include +#include /* some naming conventions * bchars, uchars -> pointer and length diff --git a/src/kernel.hcl b/src/kernel.hcl index 83fbbb1..302b5f1 100644 --- a/src/kernel.hcl +++ b/src/kernel.hcl @@ -136,22 +136,16 @@ class(#char #varying) String: FixedSizedCollection { ## // System logNl: 'xxxxx'. ## // System getUint8(ptr,offset) ## -## class System: Apex [ -## [ -## asyncsg ## async semaphore group -## gcfin_sem ## gc finalization semaphore -## gcfin_should_exit -## ossig_pid -## shr ## signal handler registry -## ] -## -## ] { -## ## var(#class) asyncsg. -## ## var(#class) gcfin_sem. -## ## var(#class) gcfin_should_exit := false. -## ## var(#class) ossig_pid. -## ## var(#class) shr. // signal handler registry -## +class System: Apex { + var(#class) asyncsg ## async semaphore group + var(#class) gcfin_sem ## gc finalization semaphore + var(#class) gcfin_should_exit + var(#class) ossig_pid + var(#class) shr ## signal handler registry + + gcfin_should_exit := false + + ## ## pooldic Log ## ## { ## ## // ----------------------------------------------------------- @@ -568,7 +562,7 @@ class(#char #varying) String: FixedSizedCollection { ## ## ## ## fun(#class,#primitive) getBytes (rawptr, offset, byte_array, offset_in_buffer, len_in_buffer). ## ## fun(#class,#primitive) putBytes (rawptr, offset, byte_array, offset_in_buffer, len_in_buffer). -## } +} ## ---------------------------------------------------------------------------------