misra: Fix crash on rule 8.2 (#3310)
The example code that reproduces this crash: ``` int misra_8_2_o( const uint32_t a1, const uint8_t *const a2 ) { return *a2 + a1; } int misra_8_2_p( const uint32_t a1, const uint8_t *const a2 ); ``` The unit test was not added because it looks like a typo and regressions are unlikely.
This commit is contained in:
parent
b89f5fbeff
commit
6432922c76
|
@ -1471,7 +1471,7 @@ class MisraChecker:
|
||||||
for _ in range(count):
|
for _ in range(count):
|
||||||
rawToken = rawToken.next
|
rawToken = rawToken.next
|
||||||
# Skip comments
|
# Skip comments
|
||||||
while rawTokens and (rawToken.str.startswith('/*') or rawToken.str.startswith('//')):
|
while rawToken and (rawToken.str.startswith('/*') or rawToken.str.startswith('//')):
|
||||||
rawToken = rawToken.next
|
rawToken = rawToken.next
|
||||||
if rawToken is None:
|
if rawToken is None:
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue