Fix issue in misra 9 x (#3409)

This commit is contained in:
PeterSchops 2021-08-21 22:01:24 +02:00 committed by GitHub
parent ee4d90b4fa
commit 7199dde161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -318,6 +318,7 @@ class InitializerParser:
if self.ed.parent != self.root:
# Check if token is correct value type for self.root.children[?]
child = self.root.getChildByValueElement(self.ed)
if self.token.valueType:
if child.elementType != 'record' or self.token.valueType.type != 'record' or child.valueType.typeScope != self.token.valueType.typeScope:
self.root.markStuctureViolation(self.token)