Skip to content

Commit

Permalink
Closure conversion fix
Browse files Browse the repository at this point in the history
  • Loading branch information
djwatson committed Nov 15, 2023
1 parent c2a7eeb commit 12d963f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/passes.scm
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
(define (generate-closure-set g clo)
(define (find-closure f)
(let loop ((groups groups) (closures closures))
(let loop2 ((lams (map car groups)))
(let loop2 ((lams (car groups)))
(if (null? lams)
(loop (cdr groups) (cdr closures))
(if (eq? f (caar lams))
Expand Down
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,5 @@ set_tests_properties(bench2/mperm PROPERTIES PASS_REGULAR_EXPRESSION "CSVLINE")
add_test(NAME bench2/equal WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test COMMAND ${CMAKE_BINARY_DIR}/src/hawk bench2/equal.scm)
set_tests_properties(bench2/equal PROPERTIES PASS_REGULAR_EXPRESSION "CSVLINE")

# Regression
add_test(NAME regression/closure WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test COMMAND ${CMAKE_BINARY_DIR}/src/hawk regression/closure.scm)
15 changes: 15 additions & 0 deletions test/regression/closure.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(define (pp)
(define (pp-expr)
(style)
max-call-head-width)
(define (pp-do) pp-expr)
(define max-call-head-width 5)
(define (style) pp-do)

(pp-expr))

(display (pp))




0 comments on commit 12d963f

Please sign in to comment.