smeup / jariko

a JAva virtual machine Rpg Interpreter written in KOtlin
Apache License 2.0
65 stars 11 forks source link

Bugfix/ls24003751/elem evaluation during execution #590

Closed davidepalladino-apuliasoft closed 2 months ago

davidepalladino-apuliasoft commented 2 months ago

Description

This work resolves evaluation of %ELEM(£40A) during execution when £40A is also an entry of PLIST.

     D £40A            S             15    DIM(300)
     ...
     D £40ANM          S              5S 0 INZ(%ELEM(£40A))
     ...
     C     *ENTRY        PLIST
     C                   PARM                    £40A
     C                   PARM                    £G40DS
     ...

In Jariko this execution caused Void value for £40A. More precisely, in the previous implementation InternalInterpreter.execute performed an initialization. initialize called eval for NumberOfElementsExpr, which called - at the end - interpreterStatus.getVar. In this case, getVar took the value from SymbolTable which was NullValue. Is wrong! Is necessary the size of array. So, the fix has been performed into eval(expression: NumberOfElementsExpr), by leaving evaluation by interpreterStatus only, at the moment, for OccurableDataStructureType.

Related to LS24003751

Checklist:

davidepalladino-apuliasoft commented 2 months ago

Updated description of this PR.

davidepalladino-apuliasoft commented 2 months ago

Updated description of this PR.