www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14576] New: [ddemangle] core.demangle unable to handle

https://issues.dlang.org/show_bug.cgi?id=14576

          Issue ID: 14576
           Summary: [ddemangle] core.demangle unable to handle ambiguity
                    in symbols
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

Example:
---
_D3std11parallelism8TaskPool28__T6reduceVAyaa5_61202b2062Z130__T6reduceTS3std9algorithm91__T9MapResultS27_D4test4mainFZ7getTermMFiZeTS3std5range15__T4iotaTyiTyiZ4iotaFyiyiZ6ResultZ9MapResultZ6reduceMFS3std9algorithm91__T9MapResultS27_D4test4mainFZ7getTermMFiZeTS3std5range15__T4iotaTyiTyiZ4iotaFyiyiZ6ResultZ9MapResultZ7useTaskMFNbNiNfKS3std11parallelism281__T4TaskS213std11parallelism3runTDFS3std9algorithm91__T9MapResultS27_D4test4mainFZ7getTermMFiZeTS3std5range15__T4iotaTyiTyiZ4iotaFyiyiZ6ResultZ9MapResultmmZeTS3std9algorithm91__T9MapResultS27_D4test4mainFZ7getTermMFiZeTS3std5range15__T4iotaTyiTyiZ4iotaFyiyiZ6ResultZ9MapResultTmTmZ4TaskZv
---

Fails at this point:
---
__T4TaskS213std11parallelism3runTDFS3std9algorithm91__T9MapResultS27_D4test4mainFZ7getTermMFiZeTS3std5range15__T4iotaTyiTyiZ4iotaFyiyiZ6ResultZ9MapResultmmZeTS3std9algorithm91__T9MapResultS27_D4test4mainFZ7getTermMFiZeTS3std5
---

Because it interprets the symbol length as '213', which is wrong - as shown in
the above mangle excerpt, it finishes where the point of the 213th character
should land, leaving the remaining mangled string as follows:
---
range15__T4iotaTyiTyiZ4iotaFyiyiZ6ResultZ9MapResultTmTmZ4TaskZv
---

Because that makes total sense.

Of course, what *should* have happened is that it works out that '213' is
infact '21', and '3' is the length of the interior symbol (std).

This happens because of failure to consider #3043

--
May 11 2015