From 904e9149bf3a16a69589849dcda3dbc2e10835c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 4 May 2018 22:27:45 +0200 Subject: [PATCH] misra: fix 16.3 false negative for conditional break --- addons/misra.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/misra.py b/addons/misra.py index 7c1e92109..4dc65afd4 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -983,10 +983,10 @@ def misra_16_3(rawTokens): state = STATE_BREAK elif token.str == '{': state = STATE_OK - elif token.str == '}' and state == STATE_BREAK: + elif token.str == '}' and state == STATE_OK: # is this {} an unconditional block of code? link = findRawLink(token) - if (link is None) or (link.previous is None) or (link.previous not in ':;{}'): + if (link is None) or (link.previous is None) or (link.previous.str not in ':;{}'): state = STATE_NONE elif token.str == 'case' or token.str == 'default': if state != STATE_OK: