Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ddmd/dmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,8 @@ public:
void toBuffer(const(char)* id, Dsymbol s)
{
size_t len = strlen(id);
if (buf.offset >= 8 * 1024 * 1024) // 8 megs ought be enough for anyone
s.error("excessive length %llu for symbol, possible recursive expansion?", len);
if (buf.offset + len >= 8 * 1024 * 1024) // 8 megs ought be enough for anyone
s.error("excessive length %llu for symbol, possible recursive expansion?", buf.offset + len);
else
{
buf.printf("%u", cast(uint)len);
Expand Down
8 changes: 4 additions & 4 deletions test/fail_compilation/fail12485.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
void dorecursive()
{
recursive([0]);
recursive!"ratherLongSymbolNameToHitTheMaximumSymbolLengthEarlierThanTheTemplateRecursionLimit_";
}

void recursive(R)(R r)
void recursive(string name)()
{
import std.algorithm;
recursive( r.filter!(e=>true) );
struct S {} // define type to kick off mangler
recursive!(name ~ name);
}