scsh-users
[Top] [All Lists]

Bug in the compile-regexp

To: scsh-news@zurich.csail.mit.edu
Subject: Bug in the compile-regexp
From: Peter Wang <tjaden@users.sourceforge.net>
Date: 17 Aug 2003 15:53:13 +1000
Organization: Alphalink (Australia) Pty. Ltd. Network News
The following patch fixes a bug in the compile-regexp procedure of
re-high.scm.  The bug can be triggered as follows:

  Welcome to scsh 0.6.4 (Olin Shivers)
  Type ,? for help.
  > (regexp-search? (posix-string->regexp "$") "test")

  Error: exception
         wrong-type-argument
         (checked-record-ref '#{Unspecific} '#{Record-type 46 cre} 1)


--- re-high.scm.orig    Wed Oct 30 23:33:51 2002
+++ re-high.scm Sun Aug 17 12:24:59 2003
@@ -33,8 +33,8 @@
      ((re-dsm? re)
       (check-cache re-dsm:posix set-re-dsm:posix))
 
-     ((re-bos? re) (or bos-cre (set! bos-cre (compile))))
-     ((re-eos? re) (or eos-cre (set! eos-cre (compile))))
+     ((re-bos? re) (if (not bos-cre) (set! bos-cre (compile))) bos-cre)
+     ((re-eos? re) (if (not eos-cre) (set! eos-cre (compile))) eos-cre)
 
      ((re-bol? re) (error "BOL regexp not supported in this implementation."))
      ((re-eol? re) (error "EOL regexp not supported in this implementation."))

<Prev in Thread] Current Thread [Next in Thread>
  • Bug in the compile-regexp, Peter Wang <=