mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-22 12:33:39 -08:00
The following code:
(let ((foo 0))
(incf (the fixnum foo) (bar)))
was being expanded into:
(let ((foo 0))
(LET* ((#:G133 (BAR)) (#:G132 (THE FIXNUM (+ (THE FIXNUM FOO) (BAR)))))
(DECLARE (:READ-ONLY #:G133))
(SETQ FOO (THE FIXNUM #:G132))))
Which is obviously going to call (BAR) twice. If (BAR) has
side-effects, then it is going to be buggy.
The old define-modify-macro had an issue with out-of-order INCF/DECF,
which is why it was replaced with Bruno Haible's macro, which is
supposed to improve THE handling. It turns out that the improvement is
a bit broken, so we're just fixing this.
Fixes #401.
|
||
|---|---|---|
| .. | ||
| auxiliary | ||
| normal-tests | ||
| stress-tests | ||
| 1am.lisp | ||
| 2am.lisp | ||
| config.lsp.in | ||
| doit.lsp | ||
| ecl-tests.asd | ||
| ecl-tests.lisp | ||
| Makefile.in | ||
| universe.lisp | ||