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
118 stars 15 forks source link

Bug where the graphing function clears the stack #929

Closed c3d closed 6 months ago

c3d commented 6 months ago

While testing tvars commands in #924, I ran across a case where the stack rendering code was crashing because reading the stack would read zero.

Investigating showed that the stack had been cut by the graph rendering for an equation, presumably because we are consuming more from the stack than is available. We need to have protections against this in the grapher.

c3d commented 6 months ago

The bug occurs because the test was using bar as a variable name, which happens to be a shortcut for barplot, which is a command with a non-zero arity.