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 19661 - SIGSEGV in std.traits.isFunction #9648

Closed
wants to merge 1 commit into from
Closed

fix issue 19661 - SIGSEGV in std.traits.isFunction #9648

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 18, 2019

The ICE didn't happen when the imported template, isFunction, was copied in the same module as the test case. Now in both cases the same compiler error is issued (and in both cases the line information misses).

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @Basile-z! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
19661 regression DMD 2.084.0 SIGSEGV in std.traits.isFunction

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

src/dmd/initsem.d Outdated Show resolved Hide resolved
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.

Fix is in wrong place.

@ghost ghost closed this Apr 19, 2019
@ghost ghost reopened this Apr 19, 2019
@@ -374,7 +374,8 @@ extern(C++) Initializer initializerSemantic(Initializer init, Scope* sc, Type t,
sc = sc.endCTFE();
if (i.exp.op == TOK.error)
{
return new ErrorInitializer();
assert(cast(ErrorExp) i.exp);
Copy link
Member

Choose a reason for hiding this comment

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

This cast is useless, because ErrorExp is an extern(C++) class

Copy link
Member

Choose a reason for hiding this comment

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

Casting it is even less correct. Again, need to find where i.exp.op was set to TOK.error.

@@ -374,7 +374,8 @@ extern(C++) Initializer initializerSemantic(Initializer init, Scope* sc, Type t,
sc = sc.endCTFE();
if (i.exp.op == TOK.error)
{
return new ErrorInitializer();
assert(cast(ErrorExp) i.exp);
Copy link
Member

Choose a reason for hiding this comment

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

Casting it is even less correct. Again, need to find where i.exp.op was set to TOK.error.

@ghost ghost closed this Apr 19, 2019
@ghost ghost deleted the issue-19661 branch April 19, 2019 10:12
@RazvanN7
Copy link
Contributor

New fix : #9652

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants