Bug 14576 – [ddemangle] core.demangle unable to handle ambiguity in symbols

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-11T21:09:27Z
Last change time
2017-08-16T13:22:37Z
Keywords
spec
Assigned to
No Owner
Creator
Iain Buclaw
Depends on
3043, 6045

Comments

Comment #0 by ibuclaw — 2015-05-11T21:09:27Z
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
Comment #1 by github-bugzilla — 2017-07-16T13:11:40Z
Commit pushed to mangle at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/f7f87ac45b995e5c5f5a7af3c7ee0629c24804a1 fix issue 14576: backtrack on ambiguous template alias parameter encoding, support no full length specified
Comment #2 by github-bugzilla — 2017-07-16T14:17:55Z
Commit pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/f7f87ac45b995e5c5f5a7af3c7ee0629c24804a1 fix issue 14576: backtrack on ambiguous template alias parameter encoding, support no full length specified
Comment #3 by github-bugzilla — 2017-08-07T12:26:00Z
Commit pushed to newCTFE at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/f7f87ac45b995e5c5f5a7af3c7ee0629c24804a1 fix issue 14576: backtrack on ambiguous template alias parameter encoding, support no full length specified
Comment #4 by github-bugzilla — 2017-08-16T13:22:37Z
Commit pushed to stable at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/f7f87ac45b995e5c5f5a7af3c7ee0629c24804a1 fix issue 14576: backtrack on ambiguous template alias parameter encoding, support no full length specified