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 Issue 19549 - -check=in=off doesn't work #9195

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

wilzbach
Copy link
Member

@wilzbach wilzbach commented Jan 4, 2019

Copy over the existing tests he said.

And again he said please copy over the existing tests.

And he said again there are still no tests.

CC @andralex @thewilsonator PLEASE PLEASE STOP MERGING STUFF WITHOUT TESTS.

With the fixes, the first test file yields a segfault of DMD, because this assertion no longer holds:

assert(s.label.statement);

but I'm not in the mood to look into this.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Auto-close Bugzilla Severity Description
19549 critical -check=in=off doesn't work

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "stable + dmd#9195"

@thewilsonator
Copy link
Contributor

Yeah the original code look very broken because if (!global.params.useIn) is true any any explicit value of the switch, i.e. in=off has the same effect as in=on! This patch doesn't take into account @safe functions however

if (global.params.useOut == CHECKENABLE.off)

needs to be something like

if (global.params.useOut == CHECKENABLE.off ||
   (global.params.useOut == CHECKENABLE.safeOnly && f.trust != TRUST.safe))

Copy link
Member

@WalterBright WalterBright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once it passes the test suite.

@wilzbach wilzbach force-pushed the tests-dip1006 branch 2 times, most recently from 7719fa4 to 11cc425 Compare January 6, 2019 13:25
@wilzbach
Copy link
Member Author

wilzbach commented Jan 6, 2019

but I'm not in the mood to look into this.

Okay, I found the missing bit, but PLEASE PLEASE PLEASE let's NOT merge new features without tests again.

Yeah the original code look very broken

Yup any kind of test would have spotted that (or you know also no implicit bool conversion from an enum in a condition).

This patch doesn't take into account @safe functions however

CHECKENABLE.safeOnly is only used for useArrayBounds (a bit confusing to the same type for both though).

@thewilsonator
Copy link
Contributor

Okay, I found the missing bit, but PLEASE PLEASE PLEASE let's NOT merge new features without tests again.

Duly noted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants