diff options
| author | Andrea Corallo | 2020-10-26 16:31:13 +0000 |
|---|---|---|
| committer | Andrea Corallo | 2020-10-26 16:34:20 +0000 |
| commit | fd9e9308d27138a16e2e93417bd7ad4448fea40a (patch) | |
| tree | 02b6ba059d6a4d12cbd4a054c996f22b8acfb96a /test/src | |
| parent | 5edc7aa0193ec73f757e85012273c159301f64a9 (diff) | |
| download | emacs-fd9e9308d27138a16e2e93417bd7ad4448fea40a.tar.gz emacs-fd9e9308d27138a16e2e93417bd7ad4448fea40a.zip | |
Make native compiler tollerant to redefined primitives (bug#44221).
* lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Rework based
on the fact that the subr can now be redefined.
* test/src/comp-tests.el (primitive-redefine-compile-44221):
New testcase.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/comp-tests.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index ae96e5d3868..446a61549d9 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -430,6 +430,15 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." | |||
| 430 | ;; Bug#42664, Bug#43280, Bug#44209. | 430 | ;; Bug#42664, Bug#43280, Bug#44209. |
| 431 | (should-not (subr-native-elisp-p (symbol-function #'comp-test-defsubst-f)))) | 431 | (should-not (subr-native-elisp-p (symbol-function #'comp-test-defsubst-f)))) |
| 432 | 432 | ||
| 433 | (comp-deftest primitive-redefine-compile-44221 () | ||
| 434 | "Test the compiler still works while primitives are redefined (bug#44221)." | ||
| 435 | (cl-letf (((symbol-function #'delete-region) | ||
| 436 | (lambda (_ _)))) | ||
| 437 | (should (subr-native-elisp-p | ||
| 438 | (native-compile | ||
| 439 | '(lambda () | ||
| 440 | (delete-region (point-min) (point-max)))))))) | ||
| 441 | |||
| 433 | 442 | ||
| 434 | ;;;;;;;;;;;;;;;;;;;;; | 443 | ;;;;;;;;;;;;;;;;;;;;; |
| 435 | ;; Tromey's tests. ;; | 444 | ;; Tromey's tests. ;; |