Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: GitHub noreply@github.com Date: Wed, 21 Sep 2022 21:36:07 UTC Commit: 740377e6d05ceb27145f41b731e521621ff2917a https://github.com/geany/geany/commit/740377e6d05ceb27145f41b731e521621ff291...
Log Message: ----------- Merge pull request #3203 from techee/cxx_mem_leak
cxx: use a trashbox for deleteing tokens allocated for anonymous parameters
Modified Paths: -------------- ctags/parsers/cxx/cxx_parser_function.c
Modified: ctags/parsers/cxx/cxx_parser_function.c 5 lines changed, 4 insertions(+), 1 deletions(-) =================================================================== @@ -1889,6 +1889,8 @@ void cxxParserEmitFunctionParameterTags(CXXTypedVariableSet * pInfo)
if(pTypeName) { + if (pInfo->uAnonymous & (0x1u << i)) + PARSER_TRASH_BOX_TAKE_BACK (pInfo->aIdentifiers[i]); cxxTokenDestroy(pInfo->aIdentifiers[i]); cxxTokenDestroy(pTypeName); } @@ -2180,6 +2182,7 @@ bool cxxParserTokenChainLooksLikeFunctionParameterList( pIdentifier->iLineNumber = t->pPrev->iLineNumber; pIdentifier->oFilePosition = t->pPrev->oFilePosition; pParamInfo->uAnonymous |= (0x1u << pParamInfo->uCount); + PARSER_TRASH_BOX (pIdentifier, cxxTokenDestroy); } pParamInfo->aIdentifiers[pParamInfo->uCount] = pIdentifier; pParamInfo->uCount++; @@ -2233,7 +2236,7 @@ bool cxxParserTokenChainLooksLikeFunctionParameterList( pParamInfo->uCount++;
PARSER_TRASH_BOX (pFakeStart, cxxTokenDestroy); - /* pFakeId may be destroyed via pParamInfo->aIdentifiers[i]. */ + PARSER_TRASH_BOX (pFakeId, cxxTokenDestroy); }
if(cxxTokenTypeIs(t,CXXTokenTypeClosingParenthesis))
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).