Skip to content
Merged
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
2 changes: 1 addition & 1 deletion sys/src/cmd/ld/dwarf.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ addhistfile(char *zentry)
static struct {
int file;
vlong line;
} includestack[16];
} includestack[64];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Increasing the stack size to 64 addresses the immediate issue, but using a hardcoded magic number is risky if bounds checks elsewhere in the code (e.g., in addhistfile) are not updated to match. It is recommended to use a named constant or the nelem() macro to ensure the array size and its bounds checks remain in sync. Additionally, given the minimal memory impact, a larger limit like 128 might be safer for extremely deep include chains.

} includestack[128];

static int includetop;
static vlong absline;

Expand Down
Loading