Fixed #12267 (Misra.py: crashes in 17.7 checker when there is macro in variable declaration) (#5768)
This commit is contained in:
parent
c79ec60bee
commit
22613dc7fb
|
@ -3358,9 +3358,9 @@ class MisraChecker:
|
||||||
continue
|
continue
|
||||||
if token.str != '(' or token.astParent:
|
if token.str != '(' or token.astParent:
|
||||||
continue
|
continue
|
||||||
if not token.astOperand1 or not token.astOperand1.isName:
|
if token.astOperand1 is None or not token.astOperand1.isName:
|
||||||
continue
|
continue
|
||||||
if token.astOperand1.varId and get_function_pointer_type(token.astOperand1.variable.typeStartToken) is None:
|
if token.astOperand1.varId and (token.astOperand1.variable is None or get_function_pointer_type(token.astOperand1.variable.typeStartToken) is None):
|
||||||
continue
|
continue
|
||||||
if token.valueType is None:
|
if token.valueType is None:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
//#12267
|
||||||
|
|
||||||
|
extern uint32_t end;
|
||||||
|
|
||||||
|
//#define KEEP // if uncomment this then wont crash
|
||||||
|
|
||||||
|
KEEP static const int32_t ptr_to_end = &end;
|
||||||
|
|
||||||
|
void foo(void)
|
||||||
|
{
|
||||||
|
(void)ptr_to_end;
|
||||||
|
}
|
Loading…
Reference in New Issue