Skip to content

Commit

Permalink
issue 7068: "QGDict::hashAsciiKey: Invalid null key" error messages (…
Browse files Browse the repository at this point in the history
…part 3)
  • Loading branch information
doxygen committed Aug 1, 2019
1 parent 6159868 commit f16a63d
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 42 deletions.
10 changes: 5 additions & 5 deletions src/code.l
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
{
ctx->objectType = stripClassName(ctx->objectVar->typeString());
//printf(" ctx->objectType=%p\n",ctx->objectType);
if (ctx->objectType)
if (ctx->objectType && !ctx->methodName.isEmpty())
{
ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
//printf(" ctx->method=%p\n",ctx->method);
Expand All @@ -1525,7 +1525,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
else // local variable
{
//printf(" object is local variable\n");
if (cd!=VariableContext::dummyContext)
if (cd!=VariableContext::dummyContext && !ctx->methodName.isEmpty())
{
ctx->method = cd->getMemberByName(ctx->methodName);
//printf(" class=%p method=%p\n",cd,ctx->method);
Expand Down Expand Up @@ -1594,7 +1594,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
{
ctx->objectType = ctx->objectType->categoryOf();
}
if (ctx->objectType)
if (ctx->objectType && !ctx->methodName.isEmpty())
{
ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
}
Expand Down Expand Up @@ -1623,7 +1623,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
if (bclass->classDef->compoundType()!=ClassDef::Protocol)
{
ctx->objectType = bclass->classDef;
if (ctx->objectType)
if (ctx->objectType && !ctx->methodName.isEmpty())
{
ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
}
Expand Down Expand Up @@ -1701,7 +1701,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
else
{
ctx->objectType = stripClassName(ictx->method->typeString());
if (ctx->objectType)
if (ctx->objectType && !ctx->methodName.isEmpty())
{
ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
}
Expand Down
91 changes: 62 additions & 29 deletions src/docparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,7 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor)
if (id.isEmpty())
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Empty anchor label");
return;
}

if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix)
Expand Down Expand Up @@ -3193,7 +3194,7 @@ DocHtmlCaption::DocHtmlCaption(DocNode *parent,const HtmlAttribList &attribs)
HtmlAttrib *opt;
for (li.toFirst();(opt=li.current());++li)
{
if (opt->name=="id") // interpret id attribute as an anchor
if (opt->name=="id" && !opt->value.isEmpty()) // interpret id attribute as an anchor
{
SectionInfo *sec = Doxygen::sectionDict->find(opt->value);
if (sec)
Expand Down Expand Up @@ -7041,17 +7042,25 @@ void DocRoot::parse()
warn_doc_error(g_fileName,doctokenizerYYlineno,"found paragraph command outside of subsubsection context!");
while (retval==RetVal_Paragraph)
{
SectionInfo *sec=Doxygen::sectionDict->find(g_token->sectionId);
if (sec)
if (!g_token->sectionId.isEmpty())
{
DocSection *s=new DocSection(this,
QMIN(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.append(s);
retval = s->parse();
SectionInfo *sec=Doxygen::sectionDict->find(g_token->sectionId);
if (sec)
{
DocSection *s=new DocSection(this,
QMIN(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.append(s);
retval = s->parse();
}
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid paragraph id `%s'; ignoring paragraph",qPrint(g_token->sectionId));
retval = 0;
}
}
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid paragraph id `%s'; ignoring paragraph",qPrint(g_token->sectionId));
warn_doc_error(g_fileName,doctokenizerYYlineno,"Missing id for paragraph; ignoring paragraph");
retval = 0;
}
}
Expand All @@ -7062,17 +7071,25 @@ void DocRoot::parse()
warn_doc_error(g_fileName,doctokenizerYYlineno,"found subsubsection command outside of subsection context!");
while (retval==RetVal_Subsubsection)
{
SectionInfo *sec=Doxygen::sectionDict->find(g_token->sectionId);
if (sec)
if (!g_token->sectionId.isEmpty())
{
DocSection *s=new DocSection(this,
QMIN(3+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.append(s);
retval = s->parse();
SectionInfo *sec=Doxygen::sectionDict->find(g_token->sectionId);
if (sec)
{
DocSection *s=new DocSection(this,
QMIN(3+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.append(s);
retval = s->parse();
}
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid subsubsection id `%s'; ignoring subsubsection",qPrint(g_token->sectionId));
retval = 0;
}
}
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid subsubsection id `%s'; ignoring subsubsection",qPrint(g_token->sectionId));
warn_doc_error(g_fileName,doctokenizerYYlineno,"Missing id for subsubsection; ignoring subsubsection");
retval = 0;
}
}
Expand All @@ -7083,17 +7100,25 @@ void DocRoot::parse()
warn_doc_error(g_fileName,doctokenizerYYlineno,"found subsection command outside of section context!");
while (retval==RetVal_Subsection)
{
SectionInfo *sec=Doxygen::sectionDict->find(g_token->sectionId);
if (sec)
if (!g_token->sectionId.isEmpty())
{
DocSection *s=new DocSection(this,
QMIN(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.append(s);
retval = s->parse();
SectionInfo *sec=Doxygen::sectionDict->find(g_token->sectionId);
if (sec)
{
DocSection *s=new DocSection(this,
QMIN(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.append(s);
retval = s->parse();
}
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid subsection id `%s'; ignoring subsection",qPrint(g_token->sectionId));
retval = 0;
}
}
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid subsection id `%s'; ignoring subsection",qPrint(g_token->sectionId));
warn_doc_error(g_fileName,doctokenizerYYlineno,"Missing id for subsection; ignoring subsection");
retval = 0;
}
}
Expand All @@ -7115,17 +7140,25 @@ void DocRoot::parse()
// then parse any number of level1 sections
while (retval==RetVal_Section)
{
SectionInfo *sec=Doxygen::sectionDict->find(g_token->sectionId);
if (sec)
if (!g_token->sectionId.isEmpty())
{
DocSection *s=new DocSection(this,
QMIN(1+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.append(s);
retval = s->parse();
SectionInfo *sec=Doxygen::sectionDict->find(g_token->sectionId);
if (sec)
{
DocSection *s=new DocSection(this,
QMIN(1+Doxygen::subpageNestingLevel,5),g_token->sectionId);
m_children.append(s);
retval = s->parse();
}
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid section id `%s'; ignoring section",qPrint(g_token->sectionId));
retval = 0;
}
}
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid section id `%s'; ignoring section",qPrint(g_token->sectionId));
warn_doc_error(g_fileName,doctokenizerYYlineno,"Missing id for section; ignoring section");
retval = 0;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -1143,9 +1143,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<ObjCReturnType>")" {
BEGIN( ObjCMethod );
}
<ObjCParams>({ID})?":" { // Keyword of parameter
<ObjCParams>({ID})?{BN}*":" { // Keyword of parameter
QCString keyw = yytext;
keyw=keyw.left(keyw.length()-1); // strip :
keyw=keyw.left(keyw.length()-1).stripWhiteSpace(); // strip :
if (keyw.isEmpty())
{
current->name += " :";
Expand Down
19 changes: 13 additions & 6 deletions src/tclscanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -2274,21 +2274,22 @@ D
}

//! Handle \c namespace statements.
static void tcl_command_NAMESPACE()
static bool tcl_command_NAMESPACE()
{
D
QCString myNs, myName, myStr;
//Entry *myEntryNs=NULL;
tcl_scan *myScan = tcl.scan.at(0);

tcl_name(myScan->ns,(*tcl.list_commandwords.at(4)),myNs,myName);
if (myName.isEmpty()) return false; // not a namespace
tcl_codify_cmd("keyword",0);
tcl_codify_cmd(NULL,1);
tcl_codify_cmd("keyword",2);
tcl_codify_cmd(NULL,3);
tcl_codify_cmd(NULL,4);
tcl_codify_cmd(NULL,5);
tcl_name(myScan->ns,(*tcl.list_commandwords.at(4)),myNs,myName);
if (myNs.length())
if (!myNs.isEmpty())
{
myName = myNs+"::"+myName;
}
Expand All @@ -2310,6 +2311,7 @@ D
tcl.word_is=' ';
}
myScan = tcl_scan_start(tcl.word_is,myStr, myName, NULL, NULL);
return true;
}

//! Handle \c itcl::class statements.
Expand Down Expand Up @@ -2636,11 +2638,16 @@ tcl_inf("->\n");
if ((*tcl.list_commandwords.at(2))=="eval")
{
if (tcl.list_commandwords.count() < 7) {myLine=__LINE__;goto command_warn;}
tcl_command_NAMESPACE();
if (tcl_command_NAMESPACE())
{
goto command_end;
}
}
else
{
tcl_command_OTHER();
goto command_end;
}
tcl_command_OTHER();
goto command_end;
}
if (myStr=="itcl::class")
{
Expand Down

0 comments on commit f16a63d

Please sign in to comment.