Skip to content

Conversation

@fm-117
Copy link
Contributor

@fm-117 fm-117 commented Sep 1, 2020

Based on 62a1c96 and adapted to this branch using SemanticDomain Lite.

@fm-117 fm-117 requested review from mayanje and rooksdo September 1, 2020 15:09
@fm-117 fm-117 self-assigned this Sep 1, 2020
@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label Sep 1, 2020
@fm-117
Copy link
Contributor Author

fm-117 commented Sep 2, 2020

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.

@fm-117 fm-117 mentioned this pull request Sep 2, 2020
@fm-117 fm-117 requested a review from smedilol September 2, 2020 14:02
Copy link
Contributor

@mayanje mayanje left a 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

@fm-117
Copy link
Contributor Author

fm-117 commented Sep 22, 2020

Now includes latest fixes from 1260_TypeCobolCFG

  • avoid multiple outgoing edges
  • fix recursion detection

@fm-117 fm-117 requested a review from mayanje September 22, 2020 15:36
Ported from original commit dae672f
@fm-117 fm-117 force-pushed the 1260_CFG_SDLite_IterativePERFORMs branch from 7aa29a2 to 88561a7 Compare September 22, 2020 15:51
@fm-117 fm-117 requested a review from mayanje September 28, 2020 14:53
@trafico-bot trafico-bot bot added ⚠️ Changes requested Pull Request needs changes before it can be reviewed again and removed 🔍 Ready for Review Pull Request is not reviewed yet labels Oct 8, 2020
Block26 -> Block28
Block27 -> Block28
Block28 -> Block29
Block29 -> Block41
Copy link
Contributor

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

Copy link
Contributor

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 .

Copy link
Contributor Author

@fm-117 fm-117 Oct 9, 2020

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
Copy link
Contributor

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
Copy link
Contributor

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.

@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed ⚠️ Changes requested Pull Request needs changes before it can be reviewed again labels Oct 15, 2020
@fm-117
Copy link
Contributor Author

fm-117 commented Oct 15, 2020

About the last two commits :

  • in GEFDOT, an empty subgraph leads to a rectangle drawn around all blocks of the graph (whereas in Graphviz, nothing is drawn for empty subgraphs). So from now on, we check the content of a subgraph before writing it to the output file.
  • in DOT (in general), if an edge belongs to a subgraph, then its target block will be included into this subgraph. This would result in PERFORM blocks being forcingly relocated into subgraphs. The fix here consists in writing edges only at the root level. As a consequence, subgraphs no longer have edges, only blocks.

This is not perfect though, there is still a bug with those blue rectangles: for example in PerformProcIterativeAfterRecursive2.dot, no rectangle is drawn at all because no subgraph is generated. This is related to the current handling of AFTER clauses. So I think it is better to leave it as it is and change that with #1783 altogether.

@fm-117 fm-117 requested review from rooksdo and smedilol October 19, 2020 15:35
Copy link
Contributor

@rooksdo rooksdo left a comment

Choose a reason for hiding this comment

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

Ok with @fm-117, the known limitations of graphic representation should be addressed in #1783. This PR is ok as it is.

@trafico-bot trafico-bot bot removed the 🔍 Ready for Review Pull Request is not reviewed yet label Oct 26, 2020
@fm-117 fm-117 merged commit c2a0f8e into 1260_CFG_SemanticDomainLite Nov 9, 2020
@trafico-bot trafico-bot bot added the ✨ Merged Pull Request has been merged successfully label Nov 9, 2020
@fm-117 fm-117 deleted the 1260_CFG_SDLite_IterativePERFORMs branch November 9, 2020 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Merged Pull Request has been merged successfully

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants