Форум: "Основная";
Текущий архив: 2018.04.01;
Скачать: [xml.tar.bz2];
ВнизОшибка в стандартной библиотеке? Найти похожие ветки
← →
vlk32 (2012-12-28 17:50) [0]
procedure TQueue<T>.SetCapacity(Value: Integer);
var
tailCount, offset: Integer;
begin
offset := Value - Length(FItems);
if offset = 0 then
Exit;
// If head <= tail, then part of the queue wraps around
// the end of the array; don"t introduce a gap in the queue.
if (FHead < FTail) or ((FHead = FTail) and (Count > 0)) then
tailCount := Length(FItems) - FTail
else
tailCount := 0;
if offset > 0 then
SetLength(FItems, Value);
if tailCount > 0 then
begin
Move(FItems[FTail], FItems[FTail + offset], tailCount * SizeOf(FItems[0]));
if offset > 0 then
FillChar(FItems[FTail], offset * SizeOf(FItems[0]), 0)
else if offset < 0 then
FillChar(FItems[Count], (- offset) * SizeOf(FItems[0]), 0); <<< !? ВОТ ТУТ ПОХОЖЕ ТРЕТСЯ НЕ ТО ЧТО НАДО
Inc(FTail, offset);
end
else if FTail > 0 then
begin
if Count > 0 then
begin
Move(FItems[FTail], FItems[0], Count * SizeOf(FItems[0]));
FillChar(FItems[FCount], FTail * SizeOf(FItems[0]), 0);
end;
Dec(FHead, FTail);
FTail := 0;
end;
if offset < 0 then
SetLength(FItems, Value);
end;
Правильный код в том месте, что я указал должен бытьFillChar(FItems[Length(FItems)+offset], (- offset) * SizeOf(FItems[0]), 0);
Есть сильно вумные чтобы проверить досконально этот момент? А то я на 146% не уверен, но бага серьезная похоже. И причем в одной из ключевых коллекций. Может в эмбаркодеро надо зарепортить?
← →
Anatoly Podgoretsky © (2012-12-28 18:34) [1]А в чем вопрос?
← →
Игорь Шевченко © (2012-12-28 20:17) [2]
> Может в эмбаркодеро надо зарепортить?
Стоит поискать по QC, может, уже кто наткнулся
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2018.04.01;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.001 c