]> git.eshelyaron.com Git - emacs.git/commit
Fix subtle bug when checking liveness of module values.
authorPhilipp Stephani <phst@google.com>
Sat, 25 Jul 2020 21:04:05 +0000 (23:04 +0200)
committerPhilipp Stephani <phst@google.com>
Sat, 25 Jul 2020 21:04:05 +0000 (23:04 +0200)
commit6355a3ec62f43c9b99d483982ff851d32dd78891
tree2a9896b373c7e713c8ec504a464d5401e8134ab8
parent609cbd63c31a21ca521507695abeda1203134c99
Fix subtle bug when checking liveness of module values.

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
(module--test-assertions--load-non-live-object-with-global-copy):
New unit test.
src/emacs-module.c
test/data/emacs-module/mod-test.c
test/src/emacs-module-tests.el