mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-04-27 19:50:44 -07:00
threading: fix race condition in ecl_unwind
If ecl_unwind is interrupted with another call to ecl_unwind
before it has decremented env->frs_top, the second call of
ecl_unwind may stop too early with its unwinding, leading to
potential segfaults.
This commit is contained in:
parent
e7838e4b86
commit
8a68a5c225
1 changed files with 3 additions and 1 deletions
|
|
@ -564,8 +564,10 @@ ecl_unwind(cl_env_ptr env, ecl_frame_ptr fr)
|
|||
{
|
||||
env->nlj_fr = fr;
|
||||
ecl_frame_ptr top = env->frs_top;
|
||||
while (top != fr && top->frs_val != ECL_PROTECT_TAG)
|
||||
while (top != fr && top->frs_val != ECL_PROTECT_TAG){
|
||||
top->frs_val = ECL_DUMMY_TAG;
|
||||
--top;
|
||||
}
|
||||
env->ihs_top = top->frs_ihs;
|
||||
ecl_bds_unwind(env, top->frs_bds_top_index);
|
||||
ECL_STACK_SET_INDEX(env, top->frs_sp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue