summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-12-30 01:50:01 +0000
committerRichard M. Stallman <rms@gnu.org>1994-12-30 01:50:01 +0000
commitf9cf06cef20516bd9744e60b6a496284655d8e6f (patch)
tree992bff80f3bf4931fcf02ce1e93b20f5932a800e
parent1d7825d7dce0f8a4112358a613f431c994a28b16 (diff)
downloademacs-f9cf06cef20516bd9744e60b6a496284655d8e6f.tar.gz
(Faref): Handle compiled function as pseudovector.
-rw-r--r--src/data.c12
1 files changed, 9 insertions, 3 deletions
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];
}