From b5c24eb440303ec534f843da2594c029971b74cd Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 10 Sep 2024 23:11:25 +0900 Subject: [PATCH] simplified message send a bit --- configure | 2 +- configure.ac | 2 +- lib/exec.c | 20 ++++---------------- lib/read.c | 5 ++++- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/configure b/configure index 81f17fd..4eba3d9 100755 --- a/configure +++ b/configure @@ -18053,7 +18053,7 @@ if test "x$ac_cv_lib_quadmath_quadmath_snprintf" = xyes then : QUADMATH_LIBS="-lquadmath" - LIBM="$LIBM -lquadmath" + LIBM="-lquadmath $LIBM" hcl_lib_quadmath_required="yes" printf "%s\n" "#define HAVE_QUADMATH_SNPRINTF 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index 36a0d68..bf14886 100644 --- a/configure.ac +++ b/configure.ac @@ -441,7 +441,7 @@ then AC_CHECK_LIB([quadmath], [quadmath_snprintf], [ QUADMATH_LIBS="-lquadmath" - LIBM="$LIBM -lquadmath" + LIBM="-lquadmath $LIBM" hcl_lib_quadmath_required="yes" AC_DEFINE(HAVE_QUADMATH_SNPRINTF, 1) ]) diff --git a/lib/exec.c b/lib/exec.c index 0043414..6c301f7 100644 --- a/lib/exec.c +++ b/lib/exec.c @@ -4246,11 +4246,12 @@ hcl_logbfmt (hcl, HCL_LOG_STDERR, ">>>%O c->sc=%O sc=%O b2=%d b3=%d nivars=%d nc if (!HCL_OBJ_IS_CHAR_POINTER(op)) /*if (!HCL_IS_SYMBOL(hcl, op))*/ { hcl_seterrbfmt (hcl, HCL_ECALL, "unable to send %O to %O - invalid message", op, rcv); /* TODO: change to HCL_ESEND?? */ - goto cannot_send; + cannot_send: + if (do_throw_with_internal_errmsg(hcl, fetched_instruction_pointer) >= 0) break; + goto oops_with_errmsg_supplement; } - else if (HCL_IS_CLASS(hcl, rcv) || HCL_IS_INSTANCE(hcl, rcv) || HCL_IS_CLASS(hcl, rcv->_class)) /* TOIDO: revisit this condition */ + else { - send_message: if (send_message(hcl, rcv, op, ((bcode >> 2) & 1) /* to_super */, b1 /* nargs */, b2 /* nrvars */) <= -1) { const hcl_ooch_t* msg = hcl_backuperrmsg(hcl); @@ -4258,19 +4259,6 @@ hcl_logbfmt (hcl, HCL_LOG_STDERR, ">>>%O c->sc=%O sc=%O b2=%d b3=%d nivars=%d nc goto cannot_send; } } - /* TODO: support non-symbol op? */ - else - { - #if 0 - hcl_seterrbfmt (hcl, HCL_ECALL, "unable to send %O to %O - invalid receiver", op, rcv); /* TODO: change to HCL_ESEND?? */ - #else - goto send_message; - #endif - - cannot_send: - if (do_throw_with_internal_errmsg(hcl, fetched_instruction_pointer) >= 0) break; - goto oops_with_errmsg_supplement; - } break; } diff --git a/lib/read.c b/lib/read.c index 3956a94..0998501 100644 --- a/lib/read.c +++ b/lib/read.c @@ -642,7 +642,10 @@ static HCL_INLINE hcl_cnode_t* leave_list (hcl_t* hcl, hcl_loc_t* list_loc, int* * defun f(a :: b c) { b := (a + 10); c := (a + 20) } * [x, y] := (f 9) ## this kind of expression - translate to set-r x y (f 9) */ - hcl_cnode_t* tmp, * rval; + hcl_cnode_t* tmp; + #if defined(TRANSFORM_ALIST) + hcl_cnode_t* rval; + #endif #if defined(TRANSFORM_ALIST) fake_tok.ptr = vocas[VOCA_SYM_SET_R].str;