Skip to content

Commit

Permalink
Support ~this with -vc-ast obfuscation
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanEngelen committed Jul 25, 2023
1 parent 0cf8c66 commit 42e6a87
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dmd/hdrgen.d
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,12 @@ public:
{
if (d.storage_class & STC.local)
return;

// Skip compiler generated aliases, e.g. `alias __xdtor = ~this()`
Loc zero_loc;
if (d.loc == zero_loc && IN_WEKA())
return;

buf.writestring("alias ");
if (d.aliassym)
{
Expand Down Expand Up @@ -1543,6 +1549,10 @@ public:

override void visit(FuncDeclaration f)
{
// Skip compiler generated functions, e.g. `opAssign`
if (f.flags & FUNCFLAG.generated && IN_WEKA())
return;

//printf("FuncDeclaration::toCBuffer() '%s'\n", f.toChars());
if (stcToBuffer(buf, f.storage_class))
buf.writeByte(' ');
Expand Down

0 comments on commit 42e6a87

Please sign in to comment.