summaryrefslogtreecommitdiff
path: root/libguile/unif.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2004-10-19 15:57:18 +0000
committerMarius Vollmer <mvo@zagadka.de>2004-10-19 15:57:18 +0000
commit9b0018a11321247054f43156e30c89aa02d385bb (patch)
tree28ccca0089c06d078d327e078d77291c70d1d7c6 /libguile/unif.c
parent5000379b9257f8d76e11c5da4ad0bfd9047c183c (diff)
downloadguile-9b0018a11321247054f43156e30c89aa02d385bb.tar.gz
(scm_array_p): When no prototype is given, explicitely test for
allowable types, do not simply return true. Thanks to Roland Orre for reporting this!
Diffstat (limited to 'libguile/unif.c')
-rw-r--r--libguile/unif.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/libguile/unif.c b/libguile/unif.c
index 8dd5b3389..f742fa986 100644
--- a/libguile/unif.c
+++ b/libguile/unif.c
@@ -262,8 +262,30 @@ SCM_DEFINE (scm_array_p, "array?", 1, 1, 0,
return SCM_BOOL_F;
v = SCM_ARRAY_V (v);
}
+
if (nprot)
- return scm_from_bool(nprot);
+ {
+ switch (SCM_TYP7 (v))
+ {
+ case scm_tc7_bvect:
+ case scm_tc7_string:
+ case scm_tc7_byvect:
+ case scm_tc7_uvect:
+ case scm_tc7_ivect:
+ case scm_tc7_svect:
+#if SCM_SIZEOF_LONG_LONG != 0
+ case scm_tc7_llvect:
+#endif
+ case scm_tc7_fvect:
+ case scm_tc7_dvect:
+ case scm_tc7_cvect:
+ case scm_tc7_vector:
+ case scm_tc7_wvect:
+ return SCM_BOOL_T;
+ default:
+ return SCM_BOOL_F;
+ }
+ }
else
{
int protp = 0;