From: Stephen Adams Date: Thu, 26 Jun 1997 23:40:24 +0000 (+0000) Subject: Fixed a bug in argument checking SUBSTRING. Introduced X-Git-Tag: 20090517-FFI~5093 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a4a75626d9d1e227b92d41d62e7d2b7f52d4cf4e;p=mit-scheme.git Fixed a bug in argument checking SUBSTRING. Introduced GUARANTEE-SUBSTRING and edited other procedures to use it. --- diff --git a/v7/src/runtime/string.scm b/v7/src/runtime/string.scm index 90d64be0d..75612242e 100644 --- a/v7/src/runtime/string.scm +++ b/v7/src/runtime/string.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: string.scm,v 14.13 1997/06/26 22:55:46 adams Exp $ +$Id: string.scm,v 14.14 1997/06/26 23:40:24 adams Exp $ Copyright (c) 1988-1995 Massachusetts Institute of Technology @@ -635,11 +635,11 @@ MIT in each case. |# (define-integrable (guarantee-substring string start end procedure) - (if (or (not (string? string)) - (not (index-fixnum? start)) - (not (index-fixnum? end)) - (not (fix:<= start end)) - (not (fix:<= end (string-length string)))) + (if (not (and (string? string) + (index-fixnum? start) + (index-fixnum? end) + (fix:<= start end) + (fix:<= end (string-length string)))) (guarantee-substring/fail string start end procedure))) (define (guarantee-substring/fail string start end procedure)