bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64526: 30.0.50; jit-compilation and multiple function definitions


From: Stefan Monnier
Subject: bug#64526: 30.0.50; jit-compilation and multiple function definitions
Date: Fri, 07 Jul 2023 21:41:24 -0400

Package: Emacs
Version: 30.0.50


Say you have a file ~/tmp/foo.el:

    ;;  -*- lexical-binding: t; -*-
    (defun sm-foo1 (a) (list a 1))
    (defun sm-foo1 (a) (list a 2))

which you byte-compile into ~/tmp/foo.elc, and then you do:

    emacs -Q -l ~/tmp/foo
    M-: (sm-foo1 'a) RET

you'll usually get `(a 2)` (and that's what we expect).  But if you enable
native compilation and erase the `eln-cache` before trying it out you
may get `(a 1)` because when the `.eln` file is reloaded on top of the
`.elc` definitions, `comp--late-register-subr` will skip the second
definition :-(

I suspect similar problems can occur when the two definitions are placed
in different files (and those files are loaded "at the same time",
i.e. the second file is loaded before the native-compilation of the
first file finishes) since `comp-deferred-pending-h` does not pay
attention to the file names.  :-(


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]