C4Aul: Fix segfault when indexing into temporary proplists

stable-5.2
Nicolas Hake 2009-07-26 19:57:57 +02:00
parent c049580a2f
commit abb08b891b
1 changed files with 5 additions and 1 deletions

View File

@ -772,10 +772,14 @@ C4Value C4AulExec::Exec(C4AulBCC *pCPos, bool fPassErrors)
assert(proplist);
if(!proplist->GetProperty(Index._getStr(), pCurVal[-1]))
{
C4Value PropList(pCurVal[-1]); // Keep proplist alive
pCurVal[-1].Set0();
if(pCPos->bccType == AB_ARRAYA_R)
{
// Insert into proplist to allow changes
proplist->SetProperty(Index._getStr(), pCurVal[-1].GetRef());
proplist->SetProperty(Index._getStr(), C4VNull);
proplist->GetProperty(Index._getStr(), pCurVal[-1]);
}
}
}
// Remove index