sc/source/core/data/bcaslot.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 4eb0ee5032903d301c0dde30ed3d25d16cab3a4c
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Mon Feb 14 10:32:24 2022 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Mon Feb 14 16:38:17 2022 +0100

    make sanitizers happy
    
    See https://gerrit.libreoffice.org/c/core/+/129892 .
    
    Change-Id: I28eb22332bff3fca2a204e9fa170eb228f371c30
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129902
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index bff56a5cd910..3126918570d8 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -739,9 +739,9 @@ void ScBroadcastAreaSlotMachine::DoChecks()
     assert( nEnd == mnBcaSlots - 1 );
     SCSIZE nOff = nStart;
     SCSIZE nBreak = nOff + nRowBreak;
-    // Do not access the ScBroadcastAreaSlot pointers, just use bogus values.
-    ScBroadcastAreaSlot** ppSlots = nullptr;
-    ScBroadcastAreaSlot** pp = nullptr;
+    std::unique_ptr<ScBroadcastAreaSlot*[]> slots( new ScBroadcastAreaSlot*[ 
mnBcaSlots ] ); // dummy, not accessed
+    ScBroadcastAreaSlot** ppSlots = slots.get();
+    ScBroadcastAreaSlot** pp = ppSlots;
     while ( nOff <= nEnd )
     {
         SCSIZE previous = nOff;
@@ -756,6 +756,8 @@ void ScBroadcastAreaSlotMachine::DoChecks()
     assert( nEnd == mnBcaSlots - 1 );
     nOff = nStart;
     nBreak = nOff + nRowBreak;
+    ppSlots = slots.get();
+    pp = ppSlots;
     while ( nOff <= nEnd )
     {
         SCSIZE previous = nOff;

Reply via email to