summaryrefslogtreecommitdiff
path: root/libguile/srfi-13.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-07-12 17:31:38 +0200
committerLudovic Courtès <ludo@gnu.org>2010-07-13 00:08:09 +0200
commit7614c983a56a30f2cda3e014840524ac7030e6d9 (patch)
treef61385407b7fa382e5898b642473fd95904518b3 /libguile/srfi-13.c
parent080391439568fa3b27283c266ed4b47fa635620f (diff)
downloadguile-7614c983a56a30f2cda3e014840524ac7030e6d9.tar.gz
Fix type-checking in the optimized path of `string=?'.
* libguile/srfi-13.c (scm_string_eq): Properly type-check S1 and S2. * test-suite/tests/strings.test ("string=?")["1st argument EOF", "2nd argument EOF"]: New tests exposing the problem.
Diffstat (limited to 'libguile/srfi-13.c')
-rw-r--r--libguile/srfi-13.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libguile/srfi-13.c b/libguile/srfi-13.c
index eec2961d4..e9bf94e9f 100644
--- a/libguile/srfi-13.c
+++ b/libguile/srfi-13.c
@@ -1168,7 +1168,8 @@ SCM_DEFINE (scm_string_eq, "string=", 2, 4, 0,
"value otherwise.")
#define FUNC_NAME s_scm_string_eq
{
- if (SCM_LIKELY (scm_i_is_narrow_string (s1) == scm_i_is_narrow_string (s2)
+ if (SCM_LIKELY (scm_is_string (s1) && scm_is_string (s2) &&
+ scm_i_is_narrow_string (s1) == scm_i_is_narrow_string (s2)
&& SCM_UNBNDP (start1) && SCM_UNBNDP (end1)
&& SCM_UNBNDP (start2) && SCM_UNBNDP (end2)))
{