unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#12883: [2.0.6] CSE bug
@ 2012-11-14 15:26 Ludovic Courtès
  2012-11-14 21:48 ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2012-11-14 15:26 UTC (permalink / raw)
  To: 12883

Hello,

This piece of code triggers a CSE bug:

--8<---------------cut here---------------start------------->8---
(use-modules (ice-9 match))

(define (snix-derivation->guix-package derivation)
  (match derivation
    (((_ _ _))
     #t)))
--8<---------------cut here---------------end--------------->8---

Or just:

--8<---------------cut here---------------start------------->8---
(define (snix-derivation->guix-package v)
  (let ((failure
         (lambda ()
           (error 'match "no matching pattern"))))
    (if (and (pair? v)
             (null? (cdr v)))
        (let ((w foo)
              (x (cdr w)))
          (if (and (pair? x)
                   (null? (cdr x)))
              #t
              (failure)))
        (failure))))
--8<---------------cut here---------------end--------------->8---

Details:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user) [1]> ,bt
In geiser/evaluation.scm:
    59:13 26 (call-with-result #<procedure ev ()>)
In unknown file:
          25 (call-with-output-string #<procedure 33727c0 at ice-9/r4rs.scm:236:3 (p)>)
In ice-9/r4rs.scm:
    176:4 24 (with-output-to-port #<variable 3374bb0 value: #<output: file /dev/pts/3>> #<procedure 4725360 at geiser/evaluation…>)
In geiser/evaluation.scm:
    63:19 23 (#<procedure 4725360 at geiser/evaluation.scm:60:15 ()>)
In ice-9/r4rs.scm:
    180:4 22 (with-error-to-port #<variable 33748f0 value: #<output: file /dev/pts/3>> #<procedure 4725300 at geiser/evaluation.…>)
In geiser/evaluation.scm:
    64:45 21 (#<procedure 4725300 at geiser/evaluation.scm:64:21 ()>)
    75:21 20 (ev)
In system/base/compile.scm:
    231:6 19 (compile (define (snix-derivation->guix-package v) (let ((failure (lambda () (error (quote match) "no …")))) (…))) # …)
   177:32 18 (lp (#<procedure compile-glil (x e opts)> #<procedure compile-asm (x e opts)> #<procedure compile-bytecode (ass…> …) …)
In language/tree-il/compile-glil.scm:
     65:2 17 (compile-glil #<tree-il (define snix-derivation->guix-package (lambda ((name . snix-derivation->guix-package)) (la…> …)
In language/tree-il/optimize.scm:
     44:6 16 (optimize! #<tree-il (lambda () (lambda-case ((() #f #f #f () ()) (define snix-derivation->guix-package (lambda ((…> …)
In language/tree-il/cse.scm:
   537:31 15 (visit #<tree-il (lambda () (lambda-case ((() #f #f #f () ()) (define snix-derivation->guix-package (lambda ((name…> …)
   543:33 14 (visit #<tree-il (lambda-case ((() #f #f #f () ()) (define snix-derivation->guix-package (lambda ((name . snix-der…> …)
   483:32 13 (visit #<tree-il (define snix-derivation->guix-package (lambda ((name . snix-derivation->guix-package)) (lambda-ca…> …)
   537:31 12 (visit #<tree-il (lambda ((name . snix-derivation->guix-package)) (lambda-case (((v) #f #f #f () (v-66965)) (let (…> …)
   543:33 11 (visit #<tree-il (lambda-case (((v) #f #f #f () (v-66965)) (let (failure) (failure-66977) ((lambda () (lambda-case…> …)
   430:34 10 (visit #<tree-il (let (failure) (failure-66977) ((lambda () (lambda-case ((() #f #f #f () ()) (apply (primitive er…> …)
   496:31  9 (visit #<tree-il (if (apply (primitive pair?) (lexical v v-66965)) (if (apply (primitive null?) (apply (primitive …> …)
   496:31  8 (visit #<tree-il (if (apply (primitive null?) (apply (primitive cdr) (lexical v v-66965))) (let (x) (x-66968) ((ap…> …)
   430:34  7 (visit #<tree-il (let (x) (x-66968) ((apply (primitive cdr) (toplevel w))) (begin (toplevel foo) (let (failure) (f…> …)
   553:39  6 (lp (#<tree-il (let (failure) (failure-66973) ((lambda () (lambda-case ((() #f #f #f () ()) (apply (primitive err…>) …)
   429:33  5 (visit #<tree-il (let (failure) (failure-66973) ((lambda () (lambda-case ((() #f #f #f () ()) (apply (primitive er…> …)
   370:41  4 (lp (#<tree-il (lambda () (lambda-case ((() #f #f #f () ()) (apply (primitive error) (const match) (const "no mat…>) …)
   403:15  3 (return #<tree-il (lambda () (lambda-case ((() #f #f #f () ()) (apply (primitive error) (const match) (const "no m…> …)
   333:28  2 (find-dominating-lexical #<tree-il (lambda () (lambda-case ((() #f #f #f () ()) (apply (primitive error) (const ma…> …)
   315:10  1 (unroll #<vhash 2c63040 8 pairs> 8 1)
In ice-9/vlist.scm:
    303:8  0 (vlist-ref #<vhash 2c63040 8 pairs> 8)
scheme@(guile-user) [1]> ,locals
  Local variables:
  $11 = vlist = #<vhash 2c63040 8 pairs>
  $12 = index = 8
  $13 = index = 0
  $14 = base = #(#() #f 0 0 0)
  $15 = offset = 0
  $16 = content = #()
  $17 = offset = 0
scheme@(guile-user) [1]> ,error
ice-9/vlist.scm:303:8: In procedure vlist-ref:
ice-9/vlist.scm:303:8: Value out of range: 0
--8<---------------cut here---------------end--------------->8---

Ludo’.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-11-21 23:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-14 15:26 bug#12883: [2.0.6] CSE bug Ludovic Courtès
2012-11-14 21:48 ` Stefan Israelsson Tampe
2012-11-14 22:10   ` Ludovic Courtès
2012-11-15 16:18     ` Stefan Israelsson Tampe
2012-11-15 16:24       ` Ludovic Courtès
2012-11-15 16:28         ` Stefan Israelsson Tampe
2012-11-18 23:07           ` Ludovic Courtès
2012-11-19 11:33             ` Stefan Israelsson Tampe
2012-11-20 20:16               ` Ludovic Courtès
2012-11-21 14:32                 ` Stefan Israelsson Tampe
2012-11-21 23:23                   ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).