Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
support LName with length 0 as "__anonymous"
Browse files Browse the repository at this point in the history
  • Loading branch information
rainers committed Jun 26, 2017
1 parent fb90abc commit 848ea8b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/core/demangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,12 @@ pure:
return;
}
auto n = decodeNumber();
if( !n || n > buf.length || n > buf.length - pos )
if( n == 0 )
{
put( "__anonymous" );
return;
}
if( n > buf.length || n > buf.length - pos )
error( "LName must be at least 1 character" );
if( '_' != front && !isAlpha( front ) )
error( "Invalid character in LName" );
Expand Down Expand Up @@ -2448,6 +2453,10 @@ version(unittest)
"pure @safe int std.format.getNth!(\"integer width\", std.traits.isIntegral, int, uint, uint).getNth(uint, uint, uint)"],
["_D3std11parallelism42__T16RoundRobinBufferTDFKAaZvTDxFNaNdNeZbZ16RoundRobinBuffer5primeMFZv",
"void std.parallelism.RoundRobinBuffer!(void delegate(ref char[]), const pure @property @trusted bool delegate()).RoundRobinBuffer.prime()"],
// Lname '0'
["_D3std9algorithm9iteration__T9MapResultSQBmQBlQBe005stripTAAyaZQBi7opSliceMFNaNbNiNfmmZSQDiQDhQDa__TQCtSQDyQDxQDq00QCmTQCjZQDq",
"pure nothrow @nogc @safe std.algorithm.iteration.MapResult!(std.algorithm.iteration.__anon.strip, "
~"immutable(char)[][]).MapResult std.algorithm.iteration.MapResult!(std.algorithm.iteration.strip, immutable(char)[][]).MapResult.opSlice(ulong, ulong)"],

// back references
["_D4core4stdc5errnoQgFZi", "int core.stdc.errno.errno()"], // identifier back reference
Expand Down

0 comments on commit 848ea8b

Please sign in to comment.