Skip to content

Commit

Permalink
fix Issue 14192 - Access Violation when assigning to shared AA
Browse files Browse the repository at this point in the history
- the runtime expects an unqualified TypeInfo for the AA and crashes
  if it is wrapped inside a TypeInfo_Shared
  • Loading branch information
MartinNowak committed Feb 19, 2015
1 parent 49d25b3 commit 5afc117
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/e2ir.c
Expand Up @@ -4658,7 +4658,7 @@ elem *toElem(Expression *e, IRState *irs)
{
n1 = el_una(OPaddr, TYnptr, n1);
s = aaGetSymbol(taa, "GetY", 1);
ti = toElem(getTypeInfo(taa->mutableOf(), NULL), irs);
ti = toElem(getTypeInfo(taa->unSharedOf()->mutableOf(), NULL), irs);
}
else
{
Expand Down
10 changes: 10 additions & 0 deletions test/runnable/xtest46.d
Expand Up @@ -7247,6 +7247,15 @@ static this()
wordsAA14038["zero"] = 0;
}

/***************************************************/
// 14192

void test14192()
{
shared int[int] map;
map[1] = 1;
}

/***************************************************/
// 13952

Expand Down Expand Up @@ -7578,6 +7587,7 @@ int main()
test8917();
test8945();
test11805();
test14192();
test163();
test9428();
test9477();
Expand Down

0 comments on commit 5afc117

Please sign in to comment.