-
-
Notifications
You must be signed in to change notification settings - Fork 667
fix regression in #20863 triggering an assertion if TypeInfo_AssociativeArray is misdefined #22126
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
Conversation
|
Thanks for your pull request, @rainers! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#22126" |
schveiguy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it passes CI, probably good.
|
Judging from the errors, this ought to be at the top of the visit method. override void visit(TypeInfoAssociativeArrayDeclaration ti)
{
if (ti.semanticRun >= PASS.semantic3)
return;
ti.semanticRun = PASS.semantic3;
|
…ociativeArray is misdefined
Good point, added. |
| tmpl.minst = sc2._module.importedFrom; // ensure it gets emitted | ||
| if (!e.isErrorExp()) | ||
| { | ||
| assert(e.isVarExp() && e.type.isTypeFunction()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just realised that this will still trigger an assert and ICE if druntime is seriously mismatched with the compiler by declaring these fields but of a different type.
class TypeInfo_AssociativeArray
{
alias aaOpEqual(K, V) = () => false;
alias aaGetHash(K, V) = () => 0;
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fail gracefully with empty declaration.