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

Faills with NullPointerException when there's fallthrough #237

Open
JD557 opened this issue Sep 9, 2023 · 0 comments
Open

Faills with NullPointerException when there's fallthrough #237

JD557 opened this issue Sep 9, 2023 · 0 comments
Assignees

Comments

@JD557
Copy link

JD557 commented Sep 9, 2023

The following piece of code makes bindgen fail with a null pointer exception:

https://github.com/libsdl-org/SDL/blob/SDL2/include/SDL_stdinc.h#L525-L551

From what I can tell, the problem seems to be with the SDL_FALLTHROUGH (https://github.com/libsdl-org/SDL/blob/SDL2/include/begin_code.h#L170-L189), but this is a bit hard to debug.

Not sure if the problem is with Clang, but maybe there could be a better error message, at least?
The workaround is pretty simple: just delete the method body and run the bindgen again.

Tested in v0.0.20 (sn-bindgen-x86_64-pc-win32)

Stack trace:

java.lang.NullPointerException
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.clang_isTranslationUnit(Unknown Source)
        at <none>.clang_isStatement(Unknown Source)
        at <none>.clang_isDeclaration(Unknown Source)
        at <none>.clang_disposeTranslationUnit(Unknown Source)
        at <none>.clang_isTranslationUnit(Unknown Source)
        at <none>.clang_isDeclaration(Unknown Source)
        at <none>.clang_disposeTranslationUnit(Unknown Source)
        at <none>.clang_isTranslationUnit(Unknown Source)
        at <none>.clang_isTranslationUnit(Unknown Source)
        at <none>.clang_isDeclaration(Unknown Source)
        at <none>.clang_visitChildren(Unknown Source)
        at <none>.clang_visitChildren(Unknown Source)
        at <none>.clang_visitChildren(Unknown Source)
        at <none>.clang_visitChildren(Unknown Source)
        at <none>.clang_visitChildren(Unknown Source)
        at <none>.(Unknown Source)
        at <none>.clang_visitChildren(Unknown Source)
        at <none>.clang_visitChildren(Unknown Source)
        at <none>.BaseThreadInitThunk(Unknown Source)
        at <none>.RtlUserThreadStart(Unknown Source)
@JD557 JD557 changed the title Null pointer on fallthrough Faills wth NullPointerException when there's fallthrough Sep 9, 2023
@JD557 JD557 changed the title Faills wth NullPointerException when there's fallthrough Faills with NullPointerException when there's fallthrough Sep 9, 2023
@keynmol keynmol self-assigned this Sep 17, 2023
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

No branches or pull requests

2 participants