-
Couldn't load subscription status.
- Fork 25
Fix for iterative and recursive PERFORMs #1765
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
Fix for iterative and recursive PERFORMs #1765
Conversation
|
A bug has been identified in the clonedPerforms handling. This sample produces 2 recursivity diagnostics although the code isn't recursive. IDENTIFICATION DIVISION.
PROGRAM-ID. DVZZMFT1.
DATA DIVISION.
PROCEDURE DIVISION.
main.
PERFORM a
GOBACK
.
a.
PERFORM b
PERFORM c
.
b.
PERFORM d
.
c.
PERFORM d
.
d.
DISPLAY "end !"
.
END PROGRAM DVZZMFT1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thus to validate this PR, I prefer wating for the last issue to be fixed, using the fix provided in branch:
https://github.com/TypeCobolTeam/TypeCobol/tree/1260_TypeCobolCFG
Ported from original commit 2c91f8a
|
Now includes latest fixes from 1260_TypeCobolCFG
|
Ported from original commit dae672f
7aa29a2 to
88561a7
Compare
TypeCobol.Analysis.Test/BasicCfgInstrs/PerformProcIterativeAfterRecursive0.dot
Show resolved
Hide resolved
| Block26 -> Block28 | ||
| Block27 -> Block28 | ||
| Block28 -> Block29 | ||
| Block29 -> Block41 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem here, the block29 should point to block30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
B-LOOP block should also be delimited by a blue line as in PerformProcedure0. Actually, PerformProcedure0 seems to avoid the bug detected by @smedilol .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not bug but a feature 😆 ! The difference between PerformProcedure0 and PerformProcedure2 is that the PERFORM B-LOOP instruction uses a TEST AFTER clause. This PR introduces specifically some changes to represent performs having a TEST AFTER clause.
| Block26 -> Block28 | ||
| Block27 -> Block28 | ||
| Block28 -> Block29 | ||
| Block29 -> Block41 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
B-LOOP block should also be delimited by a blue line as in PerformProcedure0. Actually, PerformProcedure0 seems to avoid the bug detected by @smedilol .
| ] | ||
| Block10 -> Block11 | ||
| Block10 -> Block14 | ||
| Block11 -> Block21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the same logic as @smedilol's remarks, we should have block11->block12. So, the instruction TEST AFTER should not affect the end graph.
|
About the last two commits :
This is not perfect though, there is still a bug with those blue rectangles: for example in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on 62a1c96 and adapted to this branch using SemanticDomain Lite.