Thread overview
[Issue 17157] ctRegex.matchAll doesn't set last item in Captures
Mar 08, 2017
Dmitry Olshansky
Mar 08, 2017
Dmitry Olshansky
March 08, 2017
https://issues.dlang.org/show_bug.cgi?id=17157

Dmitry Olshansky <dmitry.olsh@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh@gmail.com

--- Comment #1 from Dmitry Olshansky <dmitry.olsh@gmail.com> ---
(In reply to Alexey Kulentsov from comment #0)

> if comment at line 6 beginning is removed and ctRegex is used then we have exception:
> 
> core.exception.AssertError@/usr/include/dmd/phobos/std/regex/package.d(565):
> wrong match: 1..0
> ----------------
> ??:? _d_assert_msg [0x4edba6]
> ??:? std.regex.Captures!(immutable(char)[],
> ulong).Captures.opIndex!().opIndexinout(pure nothrow @trusted
> inout(immutable(char)[]) function(ulong)) [0x4e4f01]
> ??:? _Dmain [0x4bb73e]
> ??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
> [0x4ef333]
> ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
> function(char[][])*).tryExec(scope void delegate()) [0x4ef25b]
> ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
> function(char[][])*).runAll() [0x4ef2d8]
> ??:? void rt.dmain2._d_run_main(int, char**, extern (C) int
> function(char[][])*).tryExec(scope void delegate()) [0x4ef25b]
> ??:? _d_run_main [0x4ef1c7]
> ??:? main [0x4eae0f]
> ??:? __libc_start_main [0xc012282f]
> 
> More experiments have shown: last element of match is not set and attempt to access it leads to exception.
> 
> Compiler: DMD64 D Compiler v2.073.0
> OS: Ubuntu 16.04 LTS

Trying to reproduce with latest master (2.074~alpha) I see no exception but the
output of 2 runs differs.
With regex correctly:
0:a 1:a 2: 3: 4:
0:b 1: 2:b 3: 4:
0:c 1: 2: 3:c 4:
0:d 1: 2: 3: 4:d
With ctRegex:
0:a 1:a 2: 3: 4:
0:b 1:a 2:b 3: 4:
0:c 1:a 2: 3:c 4:
0:d 1:a 2: 3: 4:d

Investigating...

--
March 08, 2017
https://issues.dlang.org/show_bug.cgi?id=17157

Dmitry Olshansky <dmitry.olsh@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dmitry Olshansky <dmitry.olsh@gmail.com> ---
https://github.com/dlang/phobos/pull/5250

--
March 09, 2017
https://issues.dlang.org/show_bug.cgi?id=17157

--- Comment #3 from github-bugzilla@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/0e76847361ef8005f080f2cd57a111f563dc97a9 Fix issue 17157 ctRegex.matchAll doesn't set last item in Captures

https://github.com/dlang/phobos/commit/7200b368056f99dcea9c11ba68a50f89d05348fa Merge pull request #5250 from DmitryOlshansky/isssue-17157

Fix issue 17157 ctRegex.matchAll doesn't set last item in Captures

--
March 09, 2017
https://issues.dlang.org/show_bug.cgi?id=17157

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
March 22, 2017
https://issues.dlang.org/show_bug.cgi?id=17157

--- Comment #4 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/0e76847361ef8005f080f2cd57a111f563dc97a9 Fix issue 17157 ctRegex.matchAll doesn't set last item in Captures

https://github.com/dlang/phobos/commit/7200b368056f99dcea9c11ba68a50f89d05348fa Merge pull request #5250 from DmitryOlshansky/isssue-17157

--
August 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17157

--- Comment #5 from github-bugzilla@puremagic.com ---
Commits pushed to newCTFE at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/0e76847361ef8005f080f2cd57a111f563dc97a9 Fix issue 17157 ctRegex.matchAll doesn't set last item in Captures

https://github.com/dlang/phobos/commit/7200b368056f99dcea9c11ba68a50f89d05348fa Merge pull request #5250 from DmitryOlshansky/isssue-17157

--
January 05, 2018
https://issues.dlang.org/show_bug.cgi?id=17157

--- Comment #6 from github-bugzilla@puremagic.com ---
Commits pushed to dmd-cxx at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/0e76847361ef8005f080f2cd57a111f563dc97a9 Fix issue 17157 ctRegex.matchAll doesn't set last item in Captures

https://github.com/dlang/phobos/commit/7200b368056f99dcea9c11ba68a50f89d05348fa Merge pull request #5250 from DmitryOlshansky/isssue-17157

--