svl/qa/unit/svl.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 8b32a3edad52f8ac5e5f0f49b4f4e80954c2fd25
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon Oct 25 09:33:54 2021 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Oct 25 10:38:59 2021 +0200

    Fix stack-use-after-scope
    
    ...during CppunitTest_svl_qa_cppunit, after
    df42cb6552b20372f62b5a361709670db80e4ed4 "Optimize assignment from
    OUStringLiteral to OUString",
    
    > ==918==ERROR: AddressSanitizer: stack-use-after-scope on address 
0x2b2e203b5900 at pc 0x2b2e1b9004f8 bp 0x7ffc06726270 sp 0x7ffc06726268
    > READ of size 4 at 0x2b2e203b5900 thread T0
    >     #0 0x2b2e1b9004f7 in void 
rtl::str::release<_rtl_uString>(_rtl_uString*) /sal/rtl/strtmpl.hxx:1064:9
    >     #1 0x2b2e1b8d916c in rtl_uString_release /sal/rtl/ustring.cxx:1785:12
    >     #2 0x2b2e36263ec5 in rtl::OUString::~OUString() 
/include/rtl/ustring.hxx:493:9
    >     #3 0x2b2e3622c5ff in (anonymous namespace)::Test::testTdf103060() 
/svl/qa/unit/svl.cxx:553:1
    [...]
    >     [2304, 2320) 'EXPECTED_G3' (line 550) <== Memory access at offset 
2304 is inside this variable
    
    (<https://ci.libreoffice.org/job/lo_ubsan/2176/>).
    (aa2064c5c5f23f6f4b7bc44e12345b37f66995bc "Improve 
loplugin:stringliteralvar"
    had failed to introduce those OUStringLiteral variables as static.)
    
    Change-Id: I59168979fcc4b055d17d1d4f315577eef1027505
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124134
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 82e18ea91df1..523e998c60c1 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -543,12 +543,10 @@ void Test::testTdf103060()
     sExpected = "H"; // Heisei era
     checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected);
     sCode = "GG";
-    constexpr OUStringLiteral EXPECTED_G2 = u"\u5E73";
-    sExpected = EXPECTED_G2;
+    sExpected = u"\u5E73";
     checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected);
     sCode = "GGG";
-    constexpr OUStringLiteral EXPECTED_G3 = u"\u5E73\u6210";
-    sExpected = EXPECTED_G3;
+    sExpected = u"\u5E73\u6210";
     checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected);
 }
 

Reply via email to