Hi,
investigating further I have come to the conclusion that the attached
( and previously inlined ) patch is correct, in the sense that regular
expressions of the failing type are now handled correctly.
e.g.
A[\[:\]]
should find an 'A' followed by one of '[',':',']' and it does now (old
behavior: infinite loop).
I don't seem to see any regression tests for reclass ?
Also, and independent of this issue, certain regular expressions don't
work as expected, e.g.
A[\[:]
unexpectedly matches nothing, but
A[:\[]
and
A[\[\:]
do... ( as far as I know ':' should match itself unless one of the
special posix ranges is used. )
Review or comment would be greatly appreciated !
Thanks,
- Karl
index c57632a..9e21bbe 100644
--- a/regexp/source/reclass.cxx
+++ b/regexp/source/reclass.cxx
@@ -1255,6 +1255,7 @@ Regexpr::regex_compile()
break;
} else {
p = p1+1;
+ p1 ++;
last_char = (sal_Unicode)':';
set_list_bit(last_char, b);
}
Context
- [Libreoffice] [PATCH] Re: Easy hack regex compile infinite loop ( bug 41738 ) · Karl Koehler
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.