From f76eb3275726ae8847e9a2aa9484345939d6715b Mon Sep 17 00:00:00 2001 From: Chris Foster Date: Sat, 25 Aug 2018 02:44:33 +1000 Subject: [PATCH] Minor cleanup --- src/julia-syntax.scm | 4 ++-- src/rtutils.c | 2 +- src/task.c | 3 +-- src/threading.c | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 617f93859ff3a..0521cf9357eb2 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -3709,14 +3709,14 @@ f(x) = yt(x) (m (or m (let ((l (make-label))) (put! label-map (cadr e) l) l)))) - (emit `(null)) ;; save space for `leave` and `pop_exc` that might be needed + (emit `(null)) ;; save space for `leave` that might be needed (emit `(goto ,m)) (set! handler-goto-fixups (cons (list code handler-level catch-token-stack (cadr e)) handler-goto-fixups)) #f)) ;; exception handlers are lowered using - ;; (= tok (enter L)) - push handler with catch block at label L + ;; (= tok (enter L)) - push handler with catch block at label L, yielding token ;; (leave n) - pop N exception handlers ;; (pop_exc tok) - pop exception stack back to state of associated enter ((trycatch tryfinally) diff --git a/src/rtutils.c b/src/rtutils.c index 7728c44b231c0..5f1a1fa6b09bd 100644 --- a/src/rtutils.c +++ b/src/rtutils.c @@ -313,7 +313,7 @@ JL_DLLEXPORT jl_value_t *jl_apply_with_saved_exception_state(jl_value_t **args, void jl_copy_exc_stack(jl_exc_stack_t *dest, jl_exc_stack_t *src) { - assert(dest->reserve_size >= src->top); + assert(dest->reserved_size >= src->top); memcpy(jl_excstk_raw(dest), jl_excstk_raw(src), sizeof(uintptr_t)*src->top); dest->top = src->top; } diff --git a/src/task.c b/src/task.c index 18c171b547ae6..f92c63a5fa3e4 100644 --- a/src/task.c +++ b/src/task.c @@ -267,8 +267,7 @@ static void NOINLINE JL_NORETURN JL_USED_FUNC start_task(void) res = jl_apply(&t->start, 1); } JL_CATCH { - // FIXME: Persist exception stack into `exception`? - // Refactor with jl_push_exc_stack above? + // TODO: Persist exception stack as above? res = jl_current_exception(); t->exception = res; jl_gc_wb(t, res); diff --git a/src/threading.c b/src/threading.c index d8aa471f104c7..36cf96f91e70e 100644 --- a/src/threading.c +++ b/src/threading.c @@ -283,7 +283,7 @@ static void ti_initthread(int16_t tid) } memset(bt_data, 0, sizeof(uintptr_t) * (JL_MAX_BT_SIZE + 1)); ptls->bt_data = (uintptr_t*)bt_data; - ptls->exc_stack = 0; + ptls->exc_stack = NULL; jl_reserve_exc_stack(&ptls->exc_stack, JL_MAX_BT_SIZE + 2); ptls->sig_exception = NULL; #ifdef _OS_WINDOWS_