Summary
Exception handler bug when compiled with -O5?
Metadata
- Id: 18a60d0daf67b8b9c833c694b6172971d4b7cb06
- Trac id: 1695
- Type: defect
- Reporter: sjamaan
- Owner:
- Cc:
- Status: new
- Component: compiler
- Estimated difficulty: hard
- Resolution:
- Priority: major
- Milestone: 6.0.0
- Version: 5.2.0
- Changetime: 2023-11-06 22:13:03 UTC
- Created: 2020-04-10 18:30:26 UTC
- Keywords:
Description
Reported by NieDzejkob on IRC:
Compile the following program with -O4 or lower and it terminates. With -O5 it gets stuck in an endless loop in the `with-exception-handler` lambda.
(import (chicken condition))
(display
(handle-exceptions exn
(if (eq? exn 'two)
3
(abort exn))
(let [(orig (current-exception-handler))]
(with-exception-handler
(lambda (exn)
(if (eq? exn 'one)
(abort 'two)
(orig exn)))
(lambda ()
(abort 'one))))))