Skip to content

Fix #24491 - -H: nested visibility blocks drop inner visibility, causing class vtable corruption and SIGSEGV - #24549

Open
udaykiriti wants to merge 1 commit into
dlang:masterfrom
udaykiriti:fix-24491
Open

udaykiriti wants to merge 1 commit into
dlang:masterfrom
udaykiriti:fix-24491

Conversation

@udaykiriti

Copy link
Copy Markdown
Contributor

When a visibility attribute wraps a single other visibility attribute, only one can be printed. The outer one was kept, but the inner one is what applies, so private { public int f(); } became private int f();. Print the inner one.

The expected output for issue 17663 in header2.di and header2i.di recorded the old behavior: private: public struct Export {} is a public struct.
Fixes #24491

… causing class vtable corruption and SIGSEGV

When a visibility attribute wraps a single other visibility
attribute, only one can be printed. The outer one was kept, but the
inner one is what applies, so `private { public int f(); }` became
`private int f();`. Print the inner one.

The expected output for issue 17663 in header2.di and header2i.di
recorded the old behavior: `private: public struct Export {}` is a
public struct.
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

DMD perf check

Metric Base PR Δ
compile dmd itself (wall) 9.4 s 9.6 s +2.65%
All measurements
Metric Base PR Δ
compile hello.d (instr) 180.4 M 180.4 M +0.002%
compile hello.d -O -release (instr) 198.0 M 198.0 M +0.002%
compile Phobos (instr) 4,634.7 M 4,634.8 M +0.001%
compile Phobos codegen (instr) 1,412.0 M 1,412.0 M -0.001%
compile vibe.d (instr) 13,468.7 M 13,468.9 M +0.002%
compile ctRegex tests (instr) 29,475.1 M 29,475.1 M 0.000%
dmd binary size (stripped) 8.26 MB 8.26 MB 0.00%
hello binary size (stripped) 0.72 MB 0.72 MB 0.00%
peak RSS (compile hello.d) 42.15 MB 42.25 MB +0.24%
peak RSS (compile Phobos) 603.1 MB 603.1 MB +0.01%
peak RSS (compile vibe.d) 1860 MB 1860 MB 0.00%
peak RSS (compile ctRegex tests) 2032 MB 2032 MB +0.01%
page faults (compile hello.d) 8,663 8,665 +0.02%
page faults (compile Phobos) 152,429 152,430 0.00%
page faults (compile vibe.d) 474,986 474,992 0.00%
page faults (compile ctRegex tests) 518,102 518,103 0.00%
compile dmd itself (wall) 9.4 s 9.6 s +2.65%
compile ctRegex tests (wall) 3,229 ms 3,168 ms -1.88%
compile hello.d (wall) 77.2 ms 44.0 ms -43.03%
compile Phobos (wall) 1,100 ms 1,046 ms -4.88%

c3182e5 vs merge-base 2555b88 · about these metrics · historical dashboard

@thewilsonator

Copy link
Copy Markdown
Contributor

btw if you are using AI for these PRs please follow the disclosure guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-H: nested visibility blocks drop inner visibility, causing class vtable corruption and SIGSEGV

2 participants