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 19922/19923 - ICE: using typeid() or .classinfo without TypeInfo_Class #9941

Merged
merged 2 commits into from Jun 2, 2019

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Jun 1, 2019

No description provided.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
19922 critical ICE: Segmentation fault with typeid()
19923 critical ICE: typesem.d(3809): Assertion failure with .classinfo

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

@@ -4974,6 +4974,11 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
error(exp.loc, "Runtime type information is not supported for `extern(C++)` classes");
e = new ErrorExp();
}
else if (!Type.typeinfoclass)
{
error(exp.loc, "`object.TypeInfo_Class` could not be found, but is implicitly used");
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps add by typeid to the error message.

Copy link
Member Author

@ibuclaw ibuclaw Jun 1, 2019

Choose a reason for hiding this comment

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

It is consistent with the error message in no_TypeInfo.d, which the test is:

void test()
{
    int i;
    auto ti = typeid(i);
}

Which is identical to this, except getting the typeid of an int instead.

assert(Type.typeinfoclass);
if (!Type.typeinfoclass)
{
error(e.loc, "`object.TypeInfo_Class` could not be found, but is implicitly used");
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps add by classinfo to the error message.

@dlang-bot dlang-bot merged commit bf55a63 into dlang:stable Jun 2, 2019
@ibuclaw ibuclaw deleted the issue19922 branch June 2, 2019 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants