Skip to content

Commit

Permalink
issue_6597 SIGSEGV presumably caused by C++ "using" declaration
Browse files Browse the repository at this point in the history
Crash appears in  in the autogen / permod and sqlite3 code generation. In the xml code generation the problem does not appear due to the protection against the NULL pointer.
Added protection on the other places as well
  • Loading branch information
albert-github committed Nov 5, 2018
1 parent 9440d7c commit efc3349
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/defgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void generateDEFForMember(MemberDef *md,
stringToArgumentList(md->argsString(),declAl);
QCString fcnPrefix = " " + memPrefix + "param-";

if (declAl->count()>0)
if (defAl && declAl->count()>0)
{
ArgumentListIterator declAli(*declAl);
ArgumentListIterator defAli(*defAl);
Expand Down
2 changes: 1 addition & 1 deletion src/perlmodgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *)
m_output.openList("parameters");
ArgumentList *declAl = md->declArgumentList();
ArgumentList *defAl = md->argumentList();
if (declAl && declAl->count()>0)
if (declAl && defAl && declAl->count()>0)
{
ArgumentListIterator declAli(*declAl);
ArgumentListIterator defAli(*defAl);
Expand Down
2 changes: 1 addition & 1 deletion src/sqlite3gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, co
{
ArgumentList *declAl = md->declArgumentList();
ArgumentList *defAl = md->argumentList();
if (declAl!=0 && declAl->count()>0)
if (declAl!=0 && defAl!=0 && declAl->count()>0)
{
ArgumentListIterator declAli(*declAl);
ArgumentListIterator defAli(*defAl);
Expand Down

0 comments on commit efc3349

Please sign in to comment.