Skip to content

Commit 20d3a29

Browse files
Update checkio.cpp
1 parent 4ad6cb1 commit 20d3a29

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/checkio.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,9 +1539,10 @@ CheckIO::ArgumentInfo::ArgumentInfo(const Token * arg, const Settings &settings,
15391539
if (element && isStdVectorOrString()) { // isStdVectorOrString sets type token if true
15401540
element = false; // not really an array element
15411541
} else if (variableInfo->isEnumType()) {
1542-
if (variableInfo->type() && variableInfo->type()->classScope && variableInfo->type()->classScope->enumType && variableInfo->type()->classScope->enumType->isStandardType())
1542+
const bool hasEnumType = variableInfo->type() && variableInfo->type()->classScope && variableInfo->type()->classScope->enumType;
1543+
if (hasEnumType && variableInfo->type()->classScope->enumType->isStandardType())
15431544
typeToken = variableInfo->type()->classScope->enumType;
1544-
else if (!variableInfo->type()->classScope->enumType) {
1545+
else if (!hasEnumType) {
15451546
tempToken = new Token(tok1);
15461547
tempToken->str("int");
15471548
typeToken = tempToken;

0 commit comments

Comments
 (0)