From abd4e66f48971ecbcca69695b8da3e2aa09aacc0 Mon Sep 17 00:00:00 2001 From: Marius Gerbershagen Date: Sat, 21 Jul 2018 17:09:11 +0200 Subject: [PATCH] stop ecl_frs_push from setting frs_val to often The following code `(LOOP (BLOCK NIL (RETURN)))` would produce an error. ecl_frs_push would correctly set __frame->frs_val the first time, however later on control would jump to the statement after ecl_setjmp and __frame->frs_val would be set again, this time to a wrong value. Fixes #446. Also, we don't need to pass val to _ecl_frs_push anymore, so this argument has been removed. --- src/c/stacks.d | 2 +- src/h/stacks.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/c/stacks.d b/src/c/stacks.d index 42c06a814..64fdae3a7 100644 --- a/src/c/stacks.d +++ b/src/c/stacks.d @@ -557,7 +557,7 @@ frs_overflow(void) /* used as condition in list.d */ } ecl_frame_ptr -_ecl_frs_push(register cl_env_ptr env, register cl_object val) +_ecl_frs_push(register cl_env_ptr env) { /* We store a dummy tag first, to make sure that it is safe to * interrupt this method with a call to ecl_unwind. Otherwise, a diff --git a/src/h/stacks.h b/src/h/stacks.h index 49f83fd53..f71423419 100755 --- a/src/h/stacks.h +++ b/src/h/stacks.h @@ -313,12 +313,12 @@ typedef struct ecl_frame { cl_index frs_sp; } *ecl_frame_ptr; -extern ECL_API ecl_frame_ptr _ecl_frs_push(register cl_env_ptr, register cl_object); +extern ECL_API ecl_frame_ptr _ecl_frs_push(register cl_env_ptr); #define ecl_frs_push(env,val) \ - ecl_frame_ptr __frame = _ecl_frs_push(env,val); \ + ecl_frame_ptr __frame = _ecl_frs_push(env); \ ecl_disable_interrupts_env(env); \ - int __ecl_frs_push_result = ecl_setjmp(__frame->frs_jmpbuf); \ __frame->frs_val = val; \ + int __ecl_frs_push_result = ecl_setjmp(__frame->frs_jmpbuf); \ ecl_enable_interrupts_env(env) #define ecl_frs_pop(env) ((env)->frs_top--)