mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-26 19:18:50 +00:00
Treat incomplete integer literals as errors
See Bug#25120. * src/lread.c (read_integer): Treat incomplete integer literals as errors. * test/src/lread-tests.el (lread-empty-int-literal): New unit test for incomplete integer literals.
This commit is contained in:
parent
831bef1a46
commit
6eaadcc7c8
@ -2536,7 +2536,7 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix)
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
if (! valid)
|
||||
if (valid != 1)
|
||||
{
|
||||
sprintf (buf, "integer, radix %"pI"d", radix);
|
||||
invalid_syntax (buf);
|
||||
|
@ -104,4 +104,12 @@
|
||||
(ert-deftest lread-string-char-name ()
|
||||
(should (equal (read "\"a\\N{SYLOTI NAGRI LETTER DHO}b\"") "a\uA817b")))
|
||||
|
||||
(ert-deftest lread-empty-int-literal ()
|
||||
"Check that Bug#25120 is fixed."
|
||||
(should-error (read "#b") :type 'invalid-read-syntax)
|
||||
(should-error (read "#o") :type 'invalid-read-syntax)
|
||||
(should-error (read "#x") :type 'invalid-read-syntax)
|
||||
(should-error (read "#24r") :type 'invalid-read-syntax)
|
||||
(should-error (read "#") :type 'invalid-read-syntax))
|
||||
|
||||
;;; lread-tests.el ends here
|
||||
|
Loading…
Reference in New Issue
Block a user