On Wed, Jul 26, 2023 at 9:00 AM Artur T. <atecon(a)posteo.de> wrote:
Hi folks,
using latest git under Ubuntu yields a weird error with a loop. The
following definitely used to work in the past but fails now with an
"Data error".
Thanks for the report, Artur. Here's a minimal script to expose the
bug you found:
<hansl>
function void list_access (const list L)
series dx = L.dx
end function
nulldata 10
series dx = index
loop i=1..3
# fails after first iteration
list_access(dataset)
endloop
</hansl>
This sort of thing last worked with gretl 2022b; unfortunately it has
been broken since 2022c. That is because (a) 2022c introduced
compilation of "genrs" within functions that are called from a loop
(as in this example), and (b) the internal code to handle expressions
of the form listname.seriesname was not robust with respect to such
compilation. In fact it was funky old ad-hocery.
The problem is now fixed in git, with a proper, modern backend for
listname.seriesname.
To be clear, here's the exact scope of the bug that's now fixed:
* It bites when function F uses listname.seriesname and F is called
within a loop.
* It does not bite if F is called repeatedly, but not in a loop.
* It does not bite if listname.seriesname is called directly within a
loop (not via a user function).
Allin