Skip to content

Commit

Permalink
Merge pull request #4159 from rainers/aa_typeinfo
Browse files Browse the repository at this point in the history
provide full type info when calling _aaGetX
  • Loading branch information
MartinNowak committed Jan 23, 2015
2 parents 4a8df52 + 75ac48e commit ea1da14
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/e2ir.c
Expand Up @@ -4554,7 +4554,9 @@ elem *toElem(Expression *e, IRState *irs)
if (t1->ty == Taarray)
{
// set to:
// *aaGetX(aa, keyti, valuesize, &key);
// *aaGetY(aa, aati, valuesize, &key);
// or
// *aaGetRvalueX(aa, keyti, valuesize, &key);

TypeAArray *taa = (TypeAArray *)t1;
unsigned vsize = taa->next->size();
Expand All @@ -4571,21 +4573,21 @@ elem *toElem(Expression *e, IRState *irs)
elem *valuesize = el_long(TYsize_t, vsize);
//printf("valuesize: "); elem_print(valuesize);
Symbol *s;
elem* ti;
if (ie->modifiable)
{
n1 = el_una(OPaddr, TYnptr, n1);
s = aaGetSymbol(taa, "GetX", 1);
s = aaGetSymbol(taa, "GetY", 1);
ti = toElem(getInternalTypeInfo(taa, NULL), irs);
}
else
{
s = aaGetSymbol(taa, "GetRvalueX", 1);
ti = toElem(getInternalTypeInfo(taa->index, NULL), irs);
}
//printf("taa->index = %s\n", taa->index->toChars());
elem* keyti = toElem(getInternalTypeInfo(taa->index, NULL), irs);
//keyti = toElem(getTypeInfo(taa->index, NULL), irs);
//printf("keyti:\n");
//elem_print(keyti);
elem* ep = el_params(n2, valuesize, keyti, n1, NULL);
//printf("ti:\n"); elem_print(ti);
elem* ep = el_params(n2, valuesize, ti, n1, NULL);
e = el_bin(OPcall, TYnptr, el_var(s), ep);
if (irs->arrayBoundsCheck())
{
Expand Down

0 comments on commit ea1da14

Please sign in to comment.