mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
Fix infinite loop in expander
* module/ice-9/psyntax.scm (resolve-identifier): There is a case where a syntax object can resolve to itself. Prevent an infinite loop in that case by continuing to resolve by name. * module/ice-9/psyntax-pp.scm: Regenerate. * test-suite/tests/syncase.test ("infinite loop bug"): Add a test.
This commit is contained in:
parent
1bbf7f7580
commit
37ae02ffa0
3 changed files with 39 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
;;;; syncase.test --- test suite for (ice-9 syncase) -*- scheme -*-
|
||||
;;;;
|
||||
;;;; Copyright (C) 2001, 2006, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
|
||||
;;;; Copyright (C) 2001, 2006, 2009, 2010, 2011, 2013, 2015 Free Software Foundation, Inc.
|
||||
;;;;
|
||||
;;;; This library is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -307,3 +307,18 @@
|
|||
(pass-if-syntax-error "primref in (guile)"
|
||||
"not in operator position"
|
||||
(macroexpand '(@@ @@ (guile) (@@ primitive cons)))))
|
||||
|
||||
(pass-if "infinite loop bug"
|
||||
(begin
|
||||
(macroexpand
|
||||
'(let-syntax
|
||||
((define-foo
|
||||
(syntax-rules ()
|
||||
((define-foo a b)
|
||||
(begin
|
||||
(define a '())
|
||||
;; Oddly, the "*" in the define* seems to be
|
||||
;; important in triggering this bug.
|
||||
(define* (b) (set! a a)))))))
|
||||
(define-foo a c)))
|
||||
#t))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue