diff --git a/src/c/assignment.d b/src/c/assignment.d index 592816806..a3ca7866c 100644 --- a/src/c/assignment.d +++ b/src/c/assignment.d @@ -69,13 +69,13 @@ static void ecl_rem_setf_definition(cl_object sym) { cl_env_ptr the_env = ecl_process_env(); - ECL_WITH_GLOBAL_ENV_RDLOCK_BEGIN(the_env) { + ECL_WITH_GLOBAL_ENV_WRLOCK_BEGIN(the_env) { cl_object pair = ecl_gethash_safe(sym, cl_core.setf_definitions, Cnil); if (!Null(pair)) { - ECL_RPLACA(sym, Cnil); + ECL_RPLACA(pair, Cnil); ecl_remhash(sym, cl_core.setf_definitions); } - } ECL_WITH_GLOBAL_ENV_RDLOCK_END; + } ECL_WITH_GLOBAL_ENV_WRLOCK_END; } @(defun si::fset (fname def &optional macro pprint) diff --git a/src/c/reference.d b/src/c/reference.d index 5b5a62763..1a988427a 100644 --- a/src/c/reference.d +++ b/src/c/reference.d @@ -62,8 +62,10 @@ cl_fboundp(cl_object fname) if (CONSP(sym) && CDR(sym) == Cnil) { cl_object pair; sym = CAR(sym); - pair = ecl_setf_definition(sym, Cnil); - @(return ecl_cdr(pair)) + if (ECL_SYMBOLP(sym)) { + pair = ecl_setf_definition(sym, Cnil); + @(return ecl_cdr(pair)); + } } } }