mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-04 00:30:30 +02:00
Fix rank-1 indirection in array-map.c
* array-map.c: (AREF, ASET): fix buggy indirection carried over from old generalized_vector-ref/set!.
This commit is contained in:
parent
d848953d8c
commit
766f399d3b
1 changed files with 2 additions and 2 deletions
|
@ -54,7 +54,7 @@ AREF (SCM v, size_t pos)
|
||||||
scm_t_array_handle h;
|
scm_t_array_handle h;
|
||||||
SCM ret;
|
SCM ret;
|
||||||
scm_array_get_handle (v, &h);
|
scm_array_get_handle (v, &h);
|
||||||
pos = h.base + h.dims[0].lbnd + pos * h.dims[0].inc;
|
pos = h.base + (pos - h.dims[0].lbnd) * h.dims[0].inc;
|
||||||
ret = h.impl->vref (&h, pos);
|
ret = h.impl->vref (&h, pos);
|
||||||
scm_array_handle_release (&h);
|
scm_array_handle_release (&h);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -65,7 +65,7 @@ ASET (SCM v, size_t pos, SCM val)
|
||||||
{
|
{
|
||||||
scm_t_array_handle h;
|
scm_t_array_handle h;
|
||||||
scm_array_get_handle (v, &h);
|
scm_array_get_handle (v, &h);
|
||||||
pos = h.base + h.dims[0].lbnd + pos * h.dims[0].inc;
|
pos = h.base + (pos - h.dims[0].lbnd) * h.dims[0].inc;
|
||||||
h.impl->vset (&h, pos, val);
|
h.impl->vset (&h, pos, val);
|
||||||
scm_array_handle_release (&h);
|
scm_array_handle_release (&h);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue