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

Commit 848ea8b

Browse files
committed
support LName with length 0 as "__anonymous"
1 parent fb90abc commit 848ea8b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/core/demangle.d

+10-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,12 @@ pure:
585585
return;
586586
}
587587
auto n = decodeNumber();
588-
if( !n || n > buf.length || n > buf.length - pos )
588+
if( n == 0 )
589+
{
590+
put( "__anonymous" );
591+
return;
592+
}
593+
if( n > buf.length || n > buf.length - pos )
589594
error( "LName must be at least 1 character" );
590595
if( '_' != front && !isAlpha( front ) )
591596
error( "Invalid character in LName" );
@@ -2448,6 +2453,10 @@ version(unittest)
24482453
"pure @safe int std.format.getNth!(\"integer width\", std.traits.isIntegral, int, uint, uint).getNth(uint, uint, uint)"],
24492454
["_D3std11parallelism42__T16RoundRobinBufferTDFKAaZvTDxFNaNdNeZbZ16RoundRobinBuffer5primeMFZv",
24502455
"void std.parallelism.RoundRobinBuffer!(void delegate(ref char[]), const pure @property @trusted bool delegate()).RoundRobinBuffer.prime()"],
2456+
// Lname '0'
2457+
["_D3std9algorithm9iteration__T9MapResultSQBmQBlQBe005stripTAAyaZQBi7opSliceMFNaNbNiNfmmZSQDiQDhQDa__TQCtSQDyQDxQDq00QCmTQCjZQDq",
2458+
"pure nothrow @nogc @safe std.algorithm.iteration.MapResult!(std.algorithm.iteration.__anon.strip, "
2459+
~"immutable(char)[][]).MapResult std.algorithm.iteration.MapResult!(std.algorithm.iteration.strip, immutable(char)[][]).MapResult.opSlice(ulong, ulong)"],
24512460

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

0 commit comments

Comments
 (0)