mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-23 04:52:42 -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.
|
||
|---|---|---|
| .. | ||
| bdwgc | ||
| c | ||
| clos | ||
| cmp | ||
| doc | ||
| ecl | ||
| gmp | ||
| h | ||
| libffi | ||
| lsp | ||
| newcmp | ||
| tests | ||
| util | ||
| aclocal.m4 | ||
| bare.lsp.in | ||
| compile.lsp.in | ||
| config.guess | ||
| config.sub | ||
| configure | ||
| configure.ac | ||
| install.sh | ||
| Makefile.in | ||