File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1169,8 +1169,14 @@ def numberOfParentheses(tok1, tok2):
11691169def findGotoLabel (gotoToken ):
11701170 label = gotoToken .next .str
11711171 tok = gotoToken .next .next
1172+ functionScope = gotoToken .scope
1173+ while functionScope and functionScope .type != 'Function' :
1174+ functionScope = functionScope .nestedIn
1175+ functionEnd = functionScope .bodyEnd if functionScope else None
11721176 while tok :
1173- if tok .str == '}' and tok .scope .type == 'Function' :
1177+ if tok is functionEnd :
1178+ break
1179+ if functionEnd is None and tok .str == '}' and tok .scope and tok .scope .type == 'Function' :
11741180 break
11751181 if tok .str == label and tok .next .str == ':' :
11761182 return tok
Original file line number Diff line number Diff line change @@ -1464,6 +1464,23 @@ static void misra_15_3(int a) {
14641464 }
14651465}
14661466
1467+ struct misra_15_2_s {
1468+ int a ;
1469+ int b ;
1470+ };
1471+
1472+ static void misra_15_2_initializer_list (void ) {
1473+ int err = 0 ;
1474+ if (err == 0 ) {
1475+ err = 1 ;
1476+ goto done ; // 15.1
1477+ }
1478+ struct misra_15_2_s s = { 1 , 2 };
1479+ (void )s ;
1480+ done :
1481+ return ;
1482+ }
1483+
14671484static void misra_15_4 (void ) {
14681485 misra_15_4_label :
14691486 return ;
You can’t perform that action at this time.
0 commit comments