GNU bug report logs - #69573
Eager macro-expansion failure: (wrong-type-argument integer-or-marker-p nil)

Previous Next

Package: emacs;

Reported by: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>

Date: Tue, 5 Mar 2024 23:55:01 UTC

Severity: normal

Done: Andrea Corallo <acorallo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Andrea Corallo <acorallo <at> gnu.org>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Gabriele Nicolardi <gabriele <at> medialab.sissa.it>, 69573 <at> debbugs.gnu.org
Subject: bug#69573: Eager macro-expansion failure: (wrong-type-argument integer-or-marker-p nil)
Date: Sat, 09 Mar 2024 09:47:06 -0500
>> (defalias 're-search-forward-ifpmod (symbol-function 're-search-forward) ...)
[...]
> Stefan, can you help maybe?  Gabriele then does this:
[...]
> and we have found that this causes weird errors because at least some
> definitions, like `forward-paragraph', call `re-search-forward-ifpmod'
> afterwards.  This seems to happen only when using a native compiled

Sounds like a problem in the code that installs trampolines.

Andrea?

If we look at `fset`, the C code does:

    if (!NILP (Vnative_comp_enable_subr_trampolines)
        && SUBRP (function)
        && !SUBR_NATIVE_COMPILEDP (function))
      CALLN (Ffuncall, Qcomp_subr_trampoline_install, symbol);

so indeed if the SUBR_NATIVE_COMPILEDP function is stored in another
symbol, we will still call Qcomp_subr_trampoline_install, even tho it's
a case where it should not be necessary, and I suspect this can lead to
the kind of problems mentioned above, if we do something like

    (defalias 'foo (symbol-function 'bar))
    (fset 'foo <something-else>)

where native calls to `bar` could end up redirected to the definition of
`foo` :-(


        Stefan





This bug report was last modified 1 year and 117 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.