From f9cf06cef20516bd9744e60b6a496284655d8e6f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 30 Dec 1994 01:50:01 +0000 Subject: (Faref): Handle compiled function as pseudovector. --- src/data.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/data.c') diff --git a/src/data.c b/src/data.c index 5a4c26e017c..482be25e1cb 100644 --- a/src/data.c +++ b/src/data.c @@ -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]; } -- cgit v1.2.1