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/ls24004538/nested call error stack #650

Merged
merged 6 commits into from
Nov 6, 2024

Conversation

dom-apuliasoft
Copy link
Collaborator

Description

Note: This PR does not introduce/fix any RPGLE functionality but rather fixes a regression introduced in a precedent PR.

Fix a regression introduced with changes in #644 that caused errors thrown deeply in the program stack to not cleanup the stack state similarly to what we had in #642.

Related to:

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.

Copy link
Collaborator

@lanarimarco lanarimarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have missed a structural problem.
I would suggest focusing on:

  • Removing push and pop in the RpgProgram.execute implementation
  • Including them only in CallStmt.execute and ProgramInterpreter.execute

@lanarimarco lanarimarco marked this pull request as draft October 31, 2024 11:29
@dom-apuliasoft
Copy link
Collaborator Author

I moved the stack managing logic in two places:

  • When we execute a RpgProgram directly (for instance the root program)
  • When we call an RpgProgram (push occurs after checking program is valid, pop occurs when the execution ends or when we quit call statement with an error indicator)

Therefore I am unmarking this for draft state for further review.

@dom-apuliasoft dom-apuliasoft marked this pull request as ready for review November 6, 2024 13:27
@lanarimarco lanarimarco merged commit 17ffff1 into develop Nov 6, 2024
1 check passed
@lanarimarco lanarimarco deleted the bugfix/LS24004538/nested-call-error-stack branch November 6, 2024 16:02
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