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

Commit

Permalink
6466 - core.demangle incorrect demangling of variables
Browse files Browse the repository at this point in the history
  • Loading branch information
complexmath committed Aug 18, 2011
1 parent 16365a0 commit a59dd37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.dd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ $(VERSION 055, mmm dd, 2011, =================================================,
$(RUNTIMEBUGSFIXED
$(LI $(BUGZILLA 5967): Mangling of ArgClose for variadic function is swapped)
$(LI $(BUGZILLA 6493): Source code for the doc of core.time points to std.datetime.)
$(LI $(BUGZILLA 6466): core.demangle incorrect demangling of variables)
)
)
$(VERSION 054, mmm dd, 2011, =================================================,
Expand Down
12 changes: 7 additions & 5 deletions src/core/demangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ private struct Demangle
// faster than assembling the result piecemeal.


enum AddType { yes, no }
enum AddType { no, yes }


this( const(char)[] buf_, char[] dst_ = null )
{
this( buf_, AddType.no, dst_ );
this( buf_, AddType.yes, dst_ );
}


Expand All @@ -66,7 +66,7 @@ private struct Demangle
char[] dst = null;
size_t pos = 0;
size_t len = 0;
AddType addType = AddType.no;
AddType addType = AddType.yes;


static class ParseException : Exception
Expand Down Expand Up @@ -630,7 +630,7 @@ private struct Demangle
debug(trace) printf( "parseType+\n" );
debug(trace) scope(success) printf( "parseType-\n" );

enum IsDelegate { yes, no }
enum IsDelegate { no, yes }

auto beg = len;

Expand Down Expand Up @@ -930,6 +930,7 @@ private struct Demangle
case 'T': // TypeTypedef (T LName)
next();
parseQualifiedName();
pad( name );
return dst[beg .. len];
case 'D': // TypeDelegate (D TypeFunction)
next();
Expand All @@ -942,6 +943,7 @@ private struct Demangle
case 'v': // TypeVoid (v)
next();
put( "void" );
pad( name );
return dst[beg .. len];
case 'g': // TypeByte (g)
next();
Expand Down Expand Up @@ -1373,7 +1375,7 @@ private struct Demangle
debug(info) printf( "name (%.*s)\n", cast(int) name.length, name.ptr );
if( 'M' == tok() )
next(); // has 'this' pointer
if( addType )
if( AddType.yes == addType )
parseType( name );
if( pos >= buf.length )
return;
Expand Down

0 comments on commit a59dd37

Please sign in to comment.