From d886defd9b99015f61feb8be98da664e2a1d0d6c Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 5 Oct 2026 15:40:54 +0200 Subject: [PATCH] FormulaCompiler: Use boost::intrusive_ptr::get() instead of &* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- formula/source/core/api/FormulaCompiler.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 5ab0b2304429..e249924768e7 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -2535,7 +2535,7 @@ void FormulaCompiler::CallLine() pArgArray[nArgCount - 1] = mpCode - 1; // Add rest of the arguments } if (bDoIICompute) - HandleIIOpCode(&*pOpToken, pArgArray, + HandleIIOpCode(pOpToken.get(), pArgArray, std::min(nArgCount, static_cast(FORMULA_MAXPARAMSII))); } bool bDone = false; @@ -2554,7 +2554,7 @@ void FormulaCompiler::CallLine() nArgCount++; // Jumps are just normal functions for the FunctionAutoPilot tree view if (!mbJumpCommandReorder && pOpToken->GetType() == svJump) - pOpToken = new FormulaFAPToken( pOpToken->GetOpCode(), nArgCount, &*pOpToken ); + pOpToken = new FormulaFAPToken( pOpToken->GetOpCode(), nArgCount, pOpToken.get() ); else { // instead of using ocCall, built-in functions use their own OpCodes, if they are called directly