MARRAYREF: fix the bogus indexing into hash tables and fast arrays
commit331e83bad780fd7c462bb153b22f08ea5a88ea68
authorKris Katterjohn <katterjohn@gmail.com>
Sun, 5 Sep 2021 19:50:47 +0000 (5 15:50 -0400)
committerKris Katterjohn <katterjohn@gmail.com>
Sun, 5 Sep 2021 19:50:47 +0000 (5 15:50 -0400)
treecf09a2239f5929611e07eedd57f7707732333a2e
parentf2a5b735d265add02da90a7aae55bdb26f1e9dd1
MARRAYREF: fix the bogus indexing into hash tables and fast arrays

This is a very old Maxima bug (present in 5.0).

If only one index was given to MARRAYREF, then NIL was used as the
hash table key instead of the given index.

This bug affected various things, such as arrayapply, translated array
references and translated calls to subvar.

(%i1) use_fast_arrays : true$

(%i2) a[false] : 'wtf$

(%i3) a[3] : 5$

(%i4) arrayapply (a, [3]);
(%o4) wtf

(%i5) foo () := block ([b], b[1] : 2, b[1])$

(%i6) foo ();
(%o6) 2

(%i7) translate (foo)$

(%i8) foo ();
(%o8) false

No problems with the test suite or share test suite.  New tests have
been added to rtest2 and rtest_translator.
src/acall.lisp
tests/rtest2.mac
tests/rtest_translator.mac