Fix panics when class is allowlisted but its base class is not#3394
Fix panics when class is allowlisted but its base class is not#3394Darksonn wants to merge 1 commit into
Conversation
|
Hrm ... we're seeing the failure on LLVM 20+, and I didn't notice that the CI failure in #3393 was from an old LLVM instead. I guess if 20 is not included in CI then this bug isn't covered by CI right now. |
342f7d1 to
8d941ab
Compare
There was a problem hiding this comment.
Looks good but seems like clippy etc is unhappy at least (#3395).
I can try to get coverage for newer LLVM versions on CI. But the test looks good as well, tysm!
|
It seems the test might be failing in LLVM 9 because of std=c++20. Try gnu++20 or so? But if not at this point we should probably officially retire support for that LLVM version. |
|
#3396 should help here. |
8d941ab to
47457a3
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
c77eb11 to
d7dbf03
Compare
d7dbf03 to
c6d783a
Compare
|
Ok I think it's working now. I made a few more changes. |
In Android we encountered the following crash in bindgen 0.72.1:
I reduced the crash to the following reproduction test case:
The crash occurs because
has_method()is invoked for bitfields:rust-bindgen/bindgen/ir/comp.rs
Lines 785 to 794 in 9372688
rust-bindgen/bindgen/ir/comp.rs
Lines 762 to 771 in 9372688
The
has_method()method iterates the list of methods and looks them up, crashing if they are missing. However, due to the use of--allowlist-type, the base class is missing and this leads to a crash insideresolve_func(). Note that this only crashes on some LLVM versions because LLVM changed whether it tells bindgen about these uninstantiated methods.Please see #3393 for verification that this test case crashes without the fix.
Closes: #3393