mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-04-27 19:50:44 -07:00
Safer inline expansion for BOUNDP
This commit is contained in:
parent
c59b212fd4
commit
ec9727f9f5
4 changed files with 19 additions and 14 deletions
|
|
@ -141,22 +141,23 @@ cl_symbol_value(cl_object sym)
|
|||
@(return value)
|
||||
}
|
||||
|
||||
bool
|
||||
ecl_boundp(cl_env_ptr env, cl_object sym)
|
||||
{
|
||||
if (Null(sym)) {
|
||||
return 1;
|
||||
} else {
|
||||
if (!SYMBOLP(sym))
|
||||
FEtype_error_symbol(sym);
|
||||
return ECL_SYM_VAL(the_env, sym) != OBJNULL;
|
||||
}
|
||||
}
|
||||
|
||||
cl_object
|
||||
cl_boundp(cl_object sym)
|
||||
{
|
||||
const cl_env_ptr the_env = ecl_process_env();
|
||||
cl_object output;
|
||||
if (Null(sym)) {
|
||||
output = Ct;
|
||||
} else {
|
||||
if (!SYMBOLP(sym))
|
||||
FEtype_error_symbol(sym);
|
||||
if (ECL_SYM_VAL(the_env, sym) == OBJNULL)
|
||||
output = Cnil;
|
||||
else
|
||||
output = Ct;
|
||||
}
|
||||
@(return output)
|
||||
@(return (ecl_boundp(the_env,sym)? Ct : Cnil))
|
||||
}
|
||||
|
||||
cl_object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue