We would in some cases write the value to the wrong place.
This fixes the type error in the DeltaBlue V8 benchmark.
Change-Id: Ic64570248d83890d5e66d718b9087c2bf966690a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
if (!offset)
getHeadRoom();
- PropertyDescriptor pd;
- fillDescriptor(&pd, v);
--offset;
- values[offset] = pd;
+ PropertyDescriptor &pd = values[offset];
+ fillDescriptor(&pd, v);
} else {
uint idx = allocValue(v);
sparse->push_front(idx);
}
void push_back(Value v) {
if (!sparse) {
- PropertyDescriptor pd;
+ if (len + offset >= (uint)values.size())
+ values.resize(values.size() + 1);
+ PropertyDescriptor &pd = values[len + offset];
fillDescriptor(&pd, v);
- values.append(pd);
} else {
uint idx = allocValue(v);
sparse->push_back(idx, len);