• Philipp Stephani's avatar
    Fix subtle bug when checking liveness of module values. · 6355a3ec
    Philipp Stephani authored
    We can't simply look up the Lisp object in the global reference table
    because an invalid local and a valid global reference might refer to
    the same object.  Instead, we have to test the address of the global
    reference against the stored references.
    * src/emacs-module.c (module_global_reference_p): New helper function.
    (value_to_lisp): Use it.
    * test/data/emacs-module/mod-test.c
    (Fmod_test_invalid_store_copy): New test module function.
    (emacs_module_init): Export it.
    * test/src/emacs-module-tests.el
    New unit test.
emacs-module-tests.el 18.2 KB