mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-03 11:03:14 +01:00
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
There was problems with most non basic types... Added an option to premake so we can do: premake --target gnu --no-boehm to disable the Boehm GC.
This commit is contained in:
16
gen/toir.cpp
16
gen/toir.cpp
@@ -2702,18 +2702,20 @@ DValue* StructLiteralExp::toElem(IRState* p)
|
||||
LLValue* mem = 0;
|
||||
bool isinplace = true;
|
||||
|
||||
// already has memory (r-value of assignment)
|
||||
IRExp* topexp = p->topexp();
|
||||
if (topexp && topexp->e2 == this && !topexp->v->isSlice())
|
||||
{
|
||||
assert(topexp->e2 == this);
|
||||
sptr = topexp->v->getLVal();
|
||||
}
|
||||
// temporary struct literal
|
||||
if (!p->topexp() || p->topexp()->e2 != this)
|
||||
else
|
||||
{
|
||||
sptr = new llvm::AllocaInst(llt,"tmpstructliteral",p->topallocapoint());
|
||||
isinplace = false;
|
||||
}
|
||||
// already has memory
|
||||
else
|
||||
{
|
||||
assert(p->topexp()->e2 == this);
|
||||
sptr = p->topexp()->v->getLVal();
|
||||
}
|
||||
|
||||
|
||||
// num elements in literal
|
||||
unsigned n = elements->dim;
|
||||
|
||||
Reference in New Issue
Block a user