[squeak-dev] A discrepancy between bytecode execution and simulation
Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Dec 7 17:55:22 UTC 2020
Hi all, hi Eliot,
I constructed the following code snippet which evaluates to true when running it using the production execution machinery:
nil == thisContext pop
I guess this is fine, because what alternatives would the execution machinery have? It could terminate the whole VM or we could introduce something like #cannotReturn: for invalid stack frame objects. Probably the current implementation is the best despite an invalid position in the context stack has been addressed.
However, the simulation machinery treats the same snippet differently, and it throws:
Error: subscript is out of bounds: 0
I wonder whether it is acceptable to have diverging behaviors for such an ill-defined edge case between simulation and production (btw did I choose the right terms for them? :)). Might it a better alternative to raise a Warning (#notify:) only and then return nil such as the VM appears to do?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev