Fix #11812 (Crash: misra addon, infinite recursion) (#5207)

This commit is contained in:
Daniel Marjamäki 2023-07-04 04:11:03 +02:00 committed by GitHub
parent 3f832df6cb
commit 260a214ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 1 deletions

View File

@ -476,7 +476,13 @@ def createRecordChildrenDefs(ed, var):
valueType = ed.valueType valueType = ed.valueType
if not valueType or not valueType.typeScope: if not valueType or not valueType.typeScope:
return return
typeToken = var.typeEndToken
while typeToken and typeToken.isName:
typeToken = typeToken.previous
if typeToken and typeToken.str == '*':
child = ElementDef("pointer", var.nameToken, var.nameToken.valueType)
ed.addChild(child)
return
for variable in valueType.typeScope.varlist: for variable in valueType.typeScope.varlist:
if variable is var: if variable is var:
continue continue

View File

@ -0,0 +1,30 @@
/* This is the representation of the expressions to determine the
plural form. */
struct expression
{
int nargs; /* Number of arguments. */
union
{
unsigned long int num; /* Number value for `num'. */
struct expression *args[3]; /* Up to three arguments. */
} val;
};
struct expression GERMANIC_PLURAL =
{
.nargs = 2,
.val =
{
.args =
{
[0] = (struct expression *) &plvar,
[1] = (struct expression *) &plone
}
}
};