Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
c42f committed Aug 25, 2018
1 parent 1f0c5cb commit f76eb32
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/rtutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down

0 comments on commit f76eb32

Please sign in to comment.