mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 15:29:14 +02:00
* patch by Bart Broersma: avoid unsigned wrap around in TDeque.Erase, resolves #37482
git-svn-id: trunk@47122 -
This commit is contained in:
parent
080d8c28f7
commit
a19ec44b97
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -18458,6 +18458,7 @@ tests/webtbs/tw37322.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37323.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37339.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37355.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37382.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37393.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37397.pp svneol=native#text/plain
|
||||
tests/webtbs/tw37398.pp svneol=native#text/pascal
|
||||
|
@ -212,10 +212,11 @@ var i:SizeUInt;
|
||||
begin
|
||||
if Position <= Size then
|
||||
begin
|
||||
for i:=Position to Size-2 do
|
||||
begin
|
||||
Items[i]:=Items[i+1];
|
||||
end;
|
||||
if Size > 1 then
|
||||
for i:=Position to Size-2 do
|
||||
begin
|
||||
Items[i]:=Items[i+1];
|
||||
end;
|
||||
popBack();
|
||||
end;
|
||||
end;
|
||||
|
20
tests/webtbs/tw37382.pp
Normal file
20
tests/webtbs/tw37382.pp
Normal file
@ -0,0 +1,20 @@
|
||||
{$mode objfpc}
|
||||
{$h+}
|
||||
|
||||
uses
|
||||
GDeque;
|
||||
|
||||
type
|
||||
TIntQueue = specialize TDeque<Integer>;
|
||||
|
||||
var
|
||||
Q: TIntQueue;
|
||||
|
||||
begin
|
||||
Q := TIntQueue.Create;
|
||||
Q.Insert(0, 12345);
|
||||
writeln('Size=',Q.Size);
|
||||
Q.Erase(0);
|
||||
writeln('Size=',Q.Size);
|
||||
Q.Free;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user