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 18970 - DMD segfault due to opDispatch #8354

Merged
merged 1 commit into from
Jun 16, 2018

Conversation

wilzbach
Copy link
Member

The error doesn't get displayed, because for opDispatch gagging is activated:

dmd/src/dmd/typesem.d

Lines 3056 to 3063 in ecc8d82

/* opDispatch, which doesn't need IFTI, may occur instantiate error.
* e.g.
* template opDispatch(name) if (isValid!name) { ... }
*/
uint errors = gagError ? global.startGagging() : 0;
e = dti.semanticY(sc, 0);
if (gagError && global.endGagging(errors))
e = null;

(gets called from TypeStruct::dotExp(e = 'S()', ident = 'y') via semanticY and resolveUFCS)

@dlang-bot
Copy link
Contributor

dlang-bot commented Jun 12, 2018

Thanks for your pull request, @wilzbach!

Bugzilla references

Auto-close Bugzilla Severity Description
18970 critical DMD segfault due to opDispatch

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#8354"

@wilzbach wilzbach force-pushed the fix-18970 branch 2 times, most recently from 12b5bba to de3700e Compare June 12, 2018 16:54
@wilzbach wilzbach changed the base branch from master to stable June 12, 2018 16:55
@wilzbach wilzbach added the Review:WIP Work In Progress - not ready for review or pulling label Jun 12, 2018
@UplinkCoder
Copy link
Member

UplinkCoder commented Jun 13, 2018

@wilzbach gagging needs to be active for opDispatch, since it's entirely speculative compilation.
you should be able to fix the segfault without turning off gagging.
The key to success here would be inserting an ErrorExp instead of leaving this being null.
At least this is what I think taking a short glance at 5 am.

@wilzbach
Copy link
Member Author

Oh it's working (there was just an accidental line mismatch error due to rebasing).
Anyhow, I was trying to point out why the error message added here isn't shown.

The SemaphoreCI error is unrelated.

@MartinNowak MartinNowak merged commit 42e7a14 into dlang:stable Jun 16, 2018
@wilzbach wilzbach deleted the fix-18970 branch June 16, 2018 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review:WIP Work In Progress - not ready for review or pulling Severity:Bug Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants