Skip to content

Conversation

@mvertes
Copy link
Collaborator

@mvertes mvertes commented May 6, 2020

The CFG was wrong in presence of an empty last clause.

Fixes #634.

The CFG was wrong in presence of an empty last clause.

Fixes #634.
@mvertes mvertes added bug Something isn't working area/core labels May 6, 2020
@mvertes mvertes added this to the v0.8.x milestone May 6, 2020
@mvertes mvertes requested a review from mpl May 6, 2020 15:48
@mpl mpl changed the title fix: hande empty clause in switch if statement fix: handle empty clause in switch if statement May 20, 2020
Comment on lines +1513 to +1516
if len(c.child) == 0 {
c.tnext = n
c.fnext = n
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this could be:

if len(c.child) == 0 {
    c.tnext = n
    c.fnext = n
    continue
}

and then you don't need the else case, and you can unindent again the whole block.

Copy link
Collaborator

@mpl mpl left a comment

Choose a reason for hiding this comment

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

superficial review.
I leave it to you to trigger the merge, in case you want to address my suggestion first.

@mvertes mvertes merged commit 4a068ea into master May 20, 2020
@mvertes mvertes deleted the fix-634 branch May 20, 2020 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

switch with empty last clause

3 participants