aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2018-05-22 12:26:22 -0700
committerPaul Eggert2018-05-22 12:42:16 -0700
commit02f303d75f876517b7802f787413cbb418203315 (patch)
treea0a0413cb8928dd09c8a125581e3d4dbbd0cae45 /src
parenta51725280ac3f4db3b9a1a552f25fb4204f45a4d (diff)
downloademacs-02f303d75f876517b7802f787413cbb418203315.tar.gz
emacs-02f303d75f876517b7802f787413cbb418203315.zip
Fix failed assertion when load-force-doc-strings
Problem reported by Philipp Stephani (Bug#31556). * src/lread.c (read_vector): When load_force_doc_strings, check for byte code vectors that are invalid because they are too short. * test/src/lread-tests.el (lread-invalid-bytecodes): New test.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c
index b8db117c79c..239c66ccb85 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3829,9 +3829,11 @@ read_vector (Lisp_Object readcharfun, bool bytecodeflag)
3829 3829
3830 tem = read_list (1, readcharfun); 3830 tem = read_list (1, readcharfun);
3831 len = Flength (tem); 3831 len = Flength (tem);
3832 if (bytecodeflag && XFASTINT (len) <= COMPILED_STACK_DEPTH)
3833 error ("Invalid byte code");
3832 vector = Fmake_vector (len, Qnil); 3834 vector = Fmake_vector (len, Qnil);
3833 3835
3834 size = ASIZE (vector); 3836 size = XFASTINT (len);
3835 ptr = XVECTOR (vector)->contents; 3837 ptr = XVECTOR (vector)->contents;
3836 for (i = 0; i < size; i++) 3838 for (i = 0; i < size; i++)
3837 { 3839 {