Skip to content

Commit

Permalink
Misra: Fix crash (#5228)
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Jul 9, 2023
1 parent 9ad18f5 commit 276aace
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/misra_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ def createRecordChildrenDefs(ed, var):
valueType = ed.valueType
if not valueType or not valueType.typeScope:
return
if var is None:
return
typeToken = var.typeEndToken
while typeToken and typeToken.isName:
typeToken = typeToken.previous
Expand Down
10 changes: 10 additions & 0 deletions addons/test/misra/crash4.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

struct ConDesDesc {
unsigned Order;
unsigned Import;
};

static ConDesDesc ConDes[CD_TYPE_COUNT] = {
{ 0, 0 },
{ 0, 0 },
};

0 comments on commit 276aace

Please sign in to comment.