Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WithHelperKey breaks on clang with asserts on #26500

Merged
merged 1 commit into from
Nov 12, 2024

Commits on Nov 12, 2024

  1. WithHelperKey breaks on clang with asserts

    `WithHelperKey` is a template class that has an inline field that it
    uses to produce a memory address that is used as a data key. This PR is
    not concerned with the underlying causes for this unconventional design.
    Rather, this change aims to fix a clang crash that happens whenever
    nearly daily when building brave with a clang binary that has asserts on.
    In particular, it looks like some combination of the key address and the
    use `std::addressof` cause clang to assert and crash.
    
    This change works around this crash by returning the address of the
    inline variable using `&`. For a repro of the crash, see:
    
      https://godbolt.org/z/M6oq6b3sz
    
    An issue has been created for this issue as well
    
      llvm/llvm-project#111188
    cdesouza-chromium committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    4c55506 View commit details
    Browse the repository at this point in the history