diff options
Diffstat (limited to 'idlc/source/parser.y')
-rw-r--r-- | idlc/source/parser.y | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/idlc/source/parser.y b/idlc/source/parser.y index 40e82ef85216..1d81492562d5 100644 --- a/idlc/source/parser.y +++ b/idlc/source/parser.y @@ -1430,22 +1430,26 @@ const_type : * If the constant's type is a scoped name, it must resolve * to a scalar constant type */ - if ( pScope && (type = pScope->lookupByName(*$1)) ) { - if (!ErrorHandler::checkPublished(type)) - { - type = nullptr; - $$ = ET_none; - } - else - { - type = resolveTypedefs(type); - if (type->getNodeType() == NT_predefined) + if ( pScope ) { + type = pScope->lookupByName(*$1); + if (type) { + if (!ErrorHandler::checkPublished(type)) { - $$ = static_cast< AstBaseType const * >(type)-> - getExprType(); - } else - $$ = ET_any; - } + type = nullptr; + $$ = ET_none; + } + else + { + type = resolveTypedefs(type); + if (type->getNodeType() == NT_predefined) + { + $$ = static_cast< AstBaseType const * >(type)-> + getExprType(); + } else + $$ = ET_any; + } + } else + $$ = ET_any; } else $$ = ET_any; } |