mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-04-27 19:50:44 -07:00
Fix the order of array index scanning.
This commit is contained in:
parent
124862f56f
commit
2f124f7ed9
1 changed files with 7 additions and 5 deletions
|
|
@ -154,22 +154,24 @@
|
|||
`(let* ((%ndx-var ,(pop indices))
|
||||
(%output-var %ndx-var)
|
||||
(%dim-var 0))
|
||||
(declare (type si::index %ndx-var %output-var %dim-var))
|
||||
(declare (type ext:array-index %ndx-var %output-var %dim-var))
|
||||
,@(when (policy-type-assertions env)
|
||||
`((check-arrayp ,a)
|
||||
(check-expected-rank ,a ,expected-rank)))
|
||||
,@(when check
|
||||
`((check-index-in-bounds ,a %output-var %dim-var)))
|
||||
(setf %dim-var (array-dimension-fast ,a 0))
|
||||
,@(loop for j from 1
|
||||
for index in indices
|
||||
collect `(setf %dim-var (array-dimension-fast ,a ,j)
|
||||
collect `(setf %output-var
|
||||
(the ext:array-index (* %output-var %dim-var))
|
||||
%dim-var (array-dimension-fast ,a ,j)
|
||||
%ndx-var ,index)
|
||||
collect (when check
|
||||
`(check-index-in-bounds ,a %ndx-var %dim-var))
|
||||
collect `(setf %output-var
|
||||
(the si::index
|
||||
(+ (the si::index (* %output-var %dim-var))
|
||||
%ndx-var))))
|
||||
(the ext:array-index
|
||||
(+ %output-var %ndx-var))))
|
||||
%output-var))))
|
||||
|
||||
;(trace c::expand-row-major-index c::expand-aset c::expand-aref)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue