c3d / db48x

RPL runtime for the DM42 calculator, in the spirit of HP48/49/50
http://48calc.org
GNU Lesser General Public License v3.0
110 stars 13 forks source link

Argument mixup in `program::run` call #1339

Open c3d opened 5 hours ago

c3d commented 5 hours ago

The call to program::run in user_interface::end_edit() is passing Settings.SaveLastArguments(). This used to be what the parameter meant, and a leftover comment in program.cc attests to that.

However, after the runtime loop was made asynchronous, the parameter was changed to force synchronous evaluation of the program. This should always be passed as true when we evaluate the command line.

c3d commented 5 hours ago

There is a protection that checks the depth and forces evaluation if depth is 0 and the program is not running. This is probably the reason this worked even when settings were disabling SaveLastArguments.