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 segmentation fault on invalid enum field #1147

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@isaachier
Contributor

isaachier commented Jun 21, 2018

Fixes #1079. Would add a test case, but not sure how to test that the compiler errors without a segfault.

@andrewrk

This comment has been minimized.

Member

andrewrk commented Jun 21, 2018

You can add compile error tests in test/compile_errors.zig then run

make install && bin/zig build --build-file ../build.zig test-compile-errors

Feel free to put your new test at the top, so it runs first.

@andrewrk

This comment has been minimized.

Member

andrewrk commented Jun 21, 2018

I'm not convinced this is the best solution though. Let me take a look.

@isaachier

This comment has been minimized.

Contributor

isaachier commented Jun 21, 2018

Sure. Keep in mind the example in #1079 is intentionally malformed. But I'm guessing you already knew that :).

andrewrk added a commit that referenced this pull request Jun 21, 2018

@isaachier

This comment has been minimized.

Contributor

isaachier commented Jun 22, 2018

Withdrawn. Glad you found a solution.

@isaachier isaachier closed this Jun 22, 2018

@isaachier isaachier deleted the isaachier:enum-invalid-field-fix branch Jun 22, 2018

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