changeset 10290:1bcc91a4b210

(Faref): Handle compiled function as pseudovector.
author Richard M. Stallman <rms@gnu.org>
date Fri, 30 Dec 1994 01:50:01 +0000
parents 9dd21ecf6b0f
children 96273a6ec492
files src/data.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/data.c	Fri Dec 30 01:46:04 1994 +0000
+++ b/src/data.c	Fri Dec 30 01:50:01 1994 +0000
@@ -1350,9 +1350,15 @@
     }
   else
     {
-      if (!VECTORP (array) && !COMPILEDP (array))
-	array = wrong_type_argument (Qarrayp, array);
-      if (idxval < 0 || idxval >= XVECTOR (array)->size)
+      int size;
+      if (VECTORP (array))
+	size = XVECTOR (array)->size;
+      else if (COMPILEDP (array))
+	size = XVECTOR (array)->size & PSEUDOVECTOR_SIZE_MASK;
+      else
+	wrong_type_argument (Qarrayp, array);
+
+      if (idxval < 0 || idxval >= size)
 	args_out_of_range (array, idx);
       return XVECTOR (array)->contents[idxval];
     }