Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/LS24005158/Fix params assignment at the end of program called #675

Conversation

davidepalladino-apuliasoft
Copy link
Collaborator

@davidepalladino-apuliasoft davidepalladino-apuliasoft commented Dec 4, 2024

Description

This work improves the CALL and PLIST (as *ENTRY) where factors are evaluated in certain circumstance. In accord to official documentation:

  • during the CALL:
C                   CALL     'PROG'
C     *IN30         PARM      *IN27         BYTE              1

the contents of factor 2, *IN27, are placed in the result field, BYTE. When PROG returns control, the contents of the result field, BYTE, are placed in the factor 1 field, *IN30.

  • during the called program:
C     *ENTRY        PLIST
C     FieldA        PARM      FieldB        FieldC
C     FieldD        PARM      FieldE        FieldG

the contents of the result fields (FieldC and FieldG) of the parameter list are placed in the factor 1 fields (FieldA and FieldD). When the called program returns, the contents of the factor 2 fields of the parameter list (FieldB and FieldE) are placed in the result fields (FieldC and FieldG).

Technical notes

On Jariko this behaviour was not implemented. To achieve this goal, I have firstly re-factorized the PlistParam by renaming the attributes in right name for right context; then I have added a new attribute related for Factor 2; finally I have implemented the logic of assignment between program.kt and internal_interpreter.kt.

This resolves the problems thanks to the tests developed and executed on AS400.

Related to #LS24005158

Checklist:

  • If this feature involves RPGLE fixes or improvements, they are well-described in the summary.
  • There are tests for this feature.
  • RPGLE code used for tests is easily understandable and includes comments that clarify the purpose of this feature.
  • The code follows Kotlin conventions (run ./gradlew ktlintCheck).
  • The code passes all tests (run ./gradlew check).
  • Relevant documentation is included in the docs directory.

…f Factor 1 and Result, and by adding a reference for Factor 2. This is useful for evaluation at the end of sub program execution
… 2 as attribute of `PlistParam` which could correspond to the `initializationValue`
…nd called, in accord to official documentation of IBM
@lanarimarco lanarimarco merged commit 66bb0dd into develop Dec 6, 2024
1 check passed
@lanarimarco lanarimarco deleted the feature/LS24005158/fix-params-assignment-at-the-end-of-program-called branch December 6, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants