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

Fix unsafe cast in translate_c #4253

Merged
merged 1 commit into from
Jan 22, 2020
Merged

Fix unsafe cast in translate_c #4253

merged 1 commit into from
Jan 22, 2020

Conversation

LemonBoy
Copy link
Contributor

Fixes #4250

We really need some way to use LLVM's dyn_cast_or_null as bare ptrCasts without checks are a great source of bugs.

@andrewrk andrewrk merged commit a284be3 into ziglang:master Jan 22, 2020
@andrewrk
Copy link
Member

andrewrk commented Jan 22, 2020

I think we can have it. a convenient API can wrap an implementation with a big ol switch statement on the type. unhandled type can have a compile error that says "please add the extra case here and don't use a ptr cast"

@daurnimator daurnimator added bug Observed behavior contradicts documented or intended behavior translate-c C to Zig source translation feature (@cImport) labels Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior translate-c C to Zig source translation feature (@cImport)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On Mac, zig build fails with SIGSEGV when including Chipmunk headers
3 participants