GP-2747 Check for explicit case fallthru

This commit is contained in:
caheckman 2022-10-25 15:21:16 -04:00
parent 17884b8786
commit 45374b3354

View file

@ -3425,6 +3425,11 @@ FlowBlock *BlockSwitch::nextFlowAfter(const FlowBlock *bl) const
{ {
if (getBlock(0) == bl) if (getBlock(0) == bl)
return (FlowBlock *)0; // Don't know what will execute return (FlowBlock *)0; // Don't know what will execute
// Can only evaluate this if bl is a case block that falls through to another case block.
// Otherwise there is a break statement in the flow
if (bl->getType() != t_goto) // Fallthru must be a goto block
return (FlowBlock *)0;
int4 i; int4 i;
// Look for block to find flow after // Look for block to find flow after
for(i=0;i<caseblocks.size();++i) for(i=0;i<caseblocks.size();++i)