Bug 166972 - Accessing an indexed property of a COM object second time fails
Summary: Accessing an indexed property of a COM object second time fails
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.2.0 target:25.8.0.0.beta2
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-12 18:03 UTC by Mike Kaganski
Modified: 2025-06-16 07:38 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2025-06-12 18:03:02 UTC
In bug 160770, the code is like this (here is a simplified version):

Function foo()
  txt = "foo"

  regex = CreateObject("VBScript.RegExp")
  regex.Pattern = "(o)(o)"

  matches = regex.Execute(txt)

  If matches.Count > 0 Then
    i1 = matches.Item(0).SubMatches.Item(0)
    i2 = matches.Item(0).SubMatches.Item(1)
  End If
End Function

This function fails on the line that assigns i2. Commenting out the previous line (where i1 is assigned) makes it pass.

This worked in OOo; and still works in AOO. I suspect a regression from go-oo's commit 0b21b8b146fc4b982c7c9bbb866b9ff18a29332a (initial commit for vba blob ( not including container_control stuff ), 2010-10-06).
Comment 1 Mike Kaganski 2025-06-12 18:48:03 UTC
https://gerrit.libreoffice.org/c/core/+/186432
Comment 2 Commit Notification 2025-06-12 19:55:27 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b038106e8d3b24d794bfec0aa4d6b42fc470c4e4

tdf#166972: do not reset parameters in SbUnoObject::Notify

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2025-06-16 07:38:20 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/a065f3a753e547b56efcdcc2a6669356bd0ca9c8

tdf#166972: do not reset parameters in SbUnoObject::Notify

It will be available in 25.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.