]> git.eshelyaron.com Git - emacs.git/commitdiff
(Faref): Handle compiled function as pseudovector.
authorRichard M. Stallman <rms@gnu.org>
Fri, 30 Dec 1994 01:50:01 +0000 (01:50 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 30 Dec 1994 01:50:01 +0000 (01:50 +0000)
src/data.c

index 5a4c26e017c43c896a74f49edc7eb5ae390ec208..482be25e1cbbbce5ddc97481c8b0caed21fd47f8 100644 (file)
@@ -1350,9 +1350,15 @@ ARRAY may be a vector or a string, or a byte-code object.  INDEX starts at 0.")
     }
   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];
     }