Skip to content

Commit

Permalink
call to rethrow should be qualified in exception stack lowering (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored and ararslan committed Oct 30, 2018
1 parent e2f7b2f commit 0bfe685
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ typedef struct {

// Exception stack data
typedef struct {
jl_excstack_t *s; // Stack of exceptions
jl_excstack_t *s; // Stack of exceptions
size_t itr; // Iterator into exception stack
size_t i; // Iterator into backtrace data for exception
} gc_mark_excstack_t;
Expand Down
3 changes: 1 addition & 2 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3744,7 +3744,6 @@ f(x) = yt(x)
(endl (make-label))
(last-finally-handler finally-handler)
(finally (if (eq? (car e) 'tryfinally) (new-mutable-var) #f))
(finally-exception (if (eq? (car e) 'tryfinally) (new-mutable-var) #f))
(my-finally-handler #f))
;; handler block entry
(emit `(= ,handler-token (enter ,catch)))
Expand All @@ -3767,7 +3766,7 @@ f(x) = yt(x)
(mark-label catch)
(emit `(leave 1))
(if finally
(begin (leave-finally-block '(call rethrow) #f)
(begin (leave-finally-block '(call (top rethrow)) #f)
(if endl (mark-label endl))
(set! finally-handler last-finally-handler)
(compile (caddr e) break-labels #f #f)
Expand Down
10 changes: 5 additions & 5 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -670,14 +670,14 @@ typedef struct _jl_excstack_t {
// uintptr_t data[]; // Access with jl_excstack_raw
} jl_excstack_t;

STATIC_INLINE uintptr_t *jl_excstack_raw(jl_excstack_t* stack) JL_NOTSAFEPOINT
STATIC_INLINE uintptr_t *jl_excstack_raw(jl_excstack_t *stack) JL_NOTSAFEPOINT
{
return (uintptr_t*)(stack + 1);
}

// Exception stack access
STATIC_INLINE jl_value_t *jl_excstack_exception(jl_excstack_t *stack JL_PROPAGATES_ROOT,
size_t itr) JL_NOTSAFEPOINT
size_t itr) JL_NOTSAFEPOINT
{
return (jl_value_t*)(jl_excstack_raw(stack)[itr-1]);
}
Expand All @@ -696,10 +696,10 @@ STATIC_INLINE size_t jl_excstack_next(jl_excstack_t *stack, size_t itr) JL_NOTSA
}
// Exception stack manipulation
void jl_reserve_excstack(jl_excstack_t **stack JL_REQUIRE_ROOTED_SLOT,
size_t reserved_size);
size_t reserved_size);
void jl_push_excstack(jl_excstack_t **stack JL_REQUIRE_ROOTED_SLOT JL_ROOTING_ARGUMENT,
jl_value_t *exception JL_ROOTED_ARGUMENT,
uintptr_t *bt_data, size_t bt_size);
jl_value_t *exception JL_ROOTED_ARGUMENT,
uintptr_t *bt_data, size_t bt_size);
void jl_copy_excstack(jl_excstack_t *dest, jl_excstack_t *src) JL_NOTSAFEPOINT;

// timers
Expand Down

0 comments on commit 0bfe685

Please sign in to comment.