Skip to content

Commit 947c247

Browse files
authored
Fix #12651:exception in misra.py, bad code: __arm__ (cppcheck-opensource#6384)
1 parent 5f9039e commit 947c247

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

addons/misra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4056,7 +4056,7 @@ def misra_22_9(self, cfg):
40564056
def misra_22_10(self, cfg):
40574057
last_function_call = None
40584058
for token in cfg.tokenlist:
4059-
if token.isName and token.next.str == '(' and not simpleMatch(token.next.link, ') {'):
4059+
if token.isName and token.next and token.next.str == '(' and not simpleMatch(token.next.link, ') {'):
40604060
name, args = cppcheckdata.get_function_call_name_args(token)
40614061
last_function_call = name
40624062
if token.str == '}':

addons/test/misra/crash11.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// #12651
2+
__arm__

0 commit comments

Comments
 (0)