diff options
| author | Mattias EngdegÄrd | 2023-07-25 12:16:30 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2023-07-26 17:34:03 +0200 |
| commit | 82f5f3b8a26249db0679bb7dc38c44352e8fbdf5 (patch) | |
| tree | 5890c3bec8dd65921695dd52949545cf21e92707 /test | |
| parent | c50f6538cfc43d856b361347c945f6348c6f2dc9 (diff) | |
| download | emacs-82f5f3b8a26249db0679bb7dc38c44352e8fbdf5.tar.gz emacs-82f5f3b8a26249db0679bb7dc38c44352e8fbdf5.zip | |
Provide backtrace for byte-ops aref and aset
Produce synthetic backtrace entries for `aref` and `aset` byte-ops
when the index is non-fixnum, or is out of range for vector or record
arguments (bug#64613).
* src/bytecode.c (exec_byte_code): Detect type and range errors
in-line for aref and aset.
* src/data.c (syms_of_data): Declare symbols Qaref and Qaset.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--byte-op-error-cases): Add test cases.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index 16c6408c921..b549ae1fe09 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el | |||
| @@ -1953,6 +1953,15 @@ EXPECTED-POINT BINDINGS (MODES \\='\\='(ruby-mode js-mode python-mode)) \ | |||
| 1953 | ((setcdr c 5) (wrong-type-argument consp c)) | 1953 | ((setcdr c 5) (wrong-type-argument consp c)) |
| 1954 | ((nth 2 "abcd") (wrong-type-argument listp "abcd")) | 1954 | ((nth 2 "abcd") (wrong-type-argument listp "abcd")) |
| 1955 | ((elt (x y . z) 2) (wrong-type-argument listp z)) | 1955 | ((elt (x y . z) 2) (wrong-type-argument listp z)) |
| 1956 | ((aref [2 3 5] p) (wrong-type-argument fixnump p)) | ||
| 1957 | ((aref #s(a b c) p) (wrong-type-argument fixnump p)) | ||
| 1958 | ((aref "abc" p) (wrong-type-argument fixnump p)) | ||
| 1959 | ((aref [2 3 5] 3) (args-out-of-range [2 3 5] 3)) | ||
| 1960 | ((aref #s(a b c) 3) (args-out-of-range #s(a b c) 3)) | ||
| 1961 | ((aset [2 3 5] q 1) (wrong-type-argument fixnump q)) | ||
| 1962 | ((aset #s(a b c) q 1) (wrong-type-argument fixnump q)) | ||
| 1963 | ((aset [2 3 5] -1 1) (args-out-of-range [2 3 5] -1)) | ||
| 1964 | ((aset #s(a b c) -1 1) (args-out-of-range #s(a b c) -1)) | ||
| 1956 | ;; Many more to add | 1965 | ;; Many more to add |
| 1957 | )) | 1966 | )) |
| 1958 | 1967 | ||