Wrong check inserted for undefined variables
The letrec pass adds calls to undefined-variable
to ensure that right-hand sides do not refer to left-hand sides that are undefined. This causes the peval program in r7rs-benchmarks to be rejected at runtime:
An exception has been raised, but no exception handler is installed.
The condition has 3 components:
1. &assertion &violation &serious
2. &message: "Undefined variable referenced or mutated"
3. &irritants: (sum)
End of condition components.
The reason might be that psyntax expands top-level programs into letrecs where statements bind to dummy variables, but the letrec pass assumes that the letrec will be split into separate letrecs at such points.