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

Issue 6062 - segv in dmd/64 with assoc array literals #381

Merged
merged 1 commit into from
Sep 14, 2011

Conversation

yebblies
Copy link
Member

The new druntime interface uses ExpressionsToStaticArray to generate the arguments for the arrays of keys and values passed to the runtime when creating an array literal. When called, the key and value types have already completed semantic, but semantic is called again while resolving the static array type used, with a NULL scope. As TypeAArray::semantic does not have an early exit, the NULL scope replaces the proper instantiation scope. When it comes time to run semantic on the backing TemplateInstance for the aa, the NULL scope causes a segfault.

http://d.puremagic.com/issues/show_bug.cgi?id=6062

The new druntime interface uses `ExpressionsToStaticArray` to generate the arguments for the arrays of keys and values passed to the runtime when creating an array literal.  When called, the key and value types have already completed semantic, but semantic is called again while resolving the static array type used, with a `NULL` scope.  As `TypeAArray::semantic` does not have an early exit, the `NULL` scope replaces the proper instantiation scope.  When it comes time to run semantic on the backing `TemplateInstance` for the aa, the `NULL` scope causes a segfault.
WalterBright added a commit that referenced this pull request Sep 14, 2011
Issue 6062 - segv in dmd/64 with assoc array literals
@WalterBright WalterBright merged commit 5275774 into dlang:master Sep 14, 2011
braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
Supplemental changes for 3235 & 6714
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants