mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-02 02:10:46 -08:00
Remove recursion from store_function_docstring
* src/doc.c (store_function_docstring): Refactor to avoid the need for C-level recursion.
This commit is contained in:
parent
61cfd6acfe
commit
7f35d5cbaf
1 changed files with 10 additions and 10 deletions
20
src/doc.c
20
src/doc.c
|
|
@ -481,15 +481,10 @@ store_function_docstring (Lisp_Object obj, ptrdiff_t offset)
|
|||
|
||||
/* The type determines where the docstring is stored. */
|
||||
|
||||
/* Lisp_Subrs have a slot for it. */
|
||||
if (SUBRP (fun))
|
||||
{
|
||||
intptr_t negative_offset = - offset;
|
||||
XSUBR (fun)->doc = (char *) negative_offset;
|
||||
}
|
||||
|
||||
/* If it's a lisp form, stick it in the form. */
|
||||
else if (CONSP (fun))
|
||||
if (CONSP (fun) && EQ (XCAR (fun), Qmacro))
|
||||
fun = XCDR (fun);
|
||||
if (CONSP (fun))
|
||||
{
|
||||
Lisp_Object tem;
|
||||
|
||||
|
|
@ -503,8 +498,13 @@ store_function_docstring (Lisp_Object obj, ptrdiff_t offset)
|
|||
correctness is quite delicate. */
|
||||
XSETCAR (tem, make_number (offset));
|
||||
}
|
||||
else if (EQ (tem, Qmacro))
|
||||
store_function_docstring (XCDR (fun), offset);
|
||||
}
|
||||
|
||||
/* Lisp_Subrs have a slot for it. */
|
||||
else if (SUBRP (fun))
|
||||
{
|
||||
intptr_t negative_offset = - offset;
|
||||
XSUBR (fun)->doc = (char *) negative_offset;
|
||||
}
|
||||
|
||||
/* Bytecode objects sometimes have slots for it. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue