FormulaCompiler: Use boost::intrusive_ptr::get() instead of &*
Using &* can be problematic if the pointer is null. In this case it probably doesn’t matter, but using get() is probably easier to understand anyway. This also paves the way for a later compiler plugin to check for this. Change-Id: I0ba29f530c648782d7d6af8225a2eb6d5c28b5b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211844 Tested-by: Jenkins Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
This commit is contained in:
@@ -2535,7 +2535,7 @@ void FormulaCompiler::CallLine()
|
|||||||
pArgArray[nArgCount - 1] = mpCode - 1; // Add rest of the arguments
|
pArgArray[nArgCount - 1] = mpCode - 1; // Add rest of the arguments
|
||||||
}
|
}
|
||||||
if (bDoIICompute)
|
if (bDoIICompute)
|
||||||
HandleIIOpCode(&*pOpToken, pArgArray,
|
HandleIIOpCode(pOpToken.get(), pArgArray,
|
||||||
std::min(nArgCount, static_cast<sal_uInt32>(FORMULA_MAXPARAMSII)));
|
std::min(nArgCount, static_cast<sal_uInt32>(FORMULA_MAXPARAMSII)));
|
||||||
}
|
}
|
||||||
bool bDone = false;
|
bool bDone = false;
|
||||||
@@ -2554,7 +2554,7 @@ void FormulaCompiler::CallLine()
|
|||||||
nArgCount++;
|
nArgCount++;
|
||||||
// Jumps are just normal functions for the FunctionAutoPilot tree view
|
// Jumps are just normal functions for the FunctionAutoPilot tree view
|
||||||
if (!mbJumpCommandReorder && pOpToken->GetType() == svJump)
|
if (!mbJumpCommandReorder && pOpToken->GetType() == svJump)
|
||||||
pOpToken = new FormulaFAPToken( pOpToken->GetOpCode(), nArgCount, &*pOpToken );
|
pOpToken = new FormulaFAPToken( pOpToken->GetOpCode(), nArgCount, pOpToken.get() );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// instead of using ocCall, built-in functions use their own OpCodes, if they are called directly
|
// instead of using ocCall, built-in functions use their own OpCodes, if they are called directly
|
||||||
|
|||||||
Reference in New Issue
Block a user