mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 14:30:27 +02:00
+ patch by Bart B: TBucketList threw access violations after Clear, resolves #39565
+ test
This commit is contained in:
parent
bcab6185b9
commit
9ad2bdcecd
@ -2579,6 +2579,7 @@ end;
|
|||||||
destructor TCustomBucketList.Destroy;
|
destructor TCustomBucketList.Destroy;
|
||||||
begin
|
begin
|
||||||
Clear;
|
Clear;
|
||||||
|
SetLength(FBuckets,0);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2593,7 +2594,6 @@ begin
|
|||||||
for J:=B.Count-1 downto 0 do
|
for J:=B.Count-1 downto 0 do
|
||||||
DeleteItem(I,J);
|
DeleteItem(I,J);
|
||||||
end;
|
end;
|
||||||
SetLength(FBuckets,0);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function TCustomBucketList.Add(AItem, AData: Pointer): Pointer;
|
Function TCustomBucketList.Add(AItem, AData: Pointer): Pointer;
|
||||||
|
@ -2486,7 +2486,7 @@ export LOG:=$(TEST_OUTPUTDIR)/log
|
|||||||
endif
|
endif
|
||||||
LOGFILES=$(TEST_OUTPUTDIR)/log $(TEST_OUTPUTDIR)/longlog $(TEST_OUTPUTDIR)/faillist
|
LOGFILES=$(TEST_OUTPUTDIR)/log $(TEST_OUTPUTDIR)/longlog $(TEST_OUTPUTDIR)/faillist
|
||||||
LOGEXT=.testlog .tbslog .tbflog .webtbslog .webtbflog
|
LOGEXT=.testlog .tbslog .tbflog .webtbslog .webtbflog
|
||||||
TESTUNITDIRS=system dos crt objects strings sysutils math sharemem strutils matrix lineinfo ucomplex fpwidestring cpu fmtbcd windows classes character dateutil fpcunit softfpu variants sortbase sortalgs linux unixutil types nullable
|
TESTUNITDIRS=system dos crt objects strings sysutils math sharemem strutils matrix lineinfo ucomplex fpwidestring cpu fmtbcd windows classes character dateutil fpcunit softfpu variants sortbase sortalgs linux unixutil types nullable contnrs
|
||||||
TESTDIRECTDIRS=
|
TESTDIRECTDIRS=
|
||||||
TESTSUBDIRS=cg cg/variants cg/cdecl cpu16 cpu16/i8086 library opt $(addprefix units/,$(TESTUNITDIRS))
|
TESTSUBDIRS=cg cg/variants cg/cdecl cpu16 cpu16/i8086 library opt $(addprefix units/,$(TESTUNITDIRS))
|
||||||
TESTPACKAGESDIRS=win-base webtbs hash fcl-registry fcl-process zlib fcl-db fcl-xml cocoaint bzip2 fcl-net
|
TESTPACKAGESDIRS=win-base webtbs hash fcl-registry fcl-process zlib fcl-db fcl-xml cocoaint bzip2 fcl-net
|
||||||
|
@ -159,7 +159,7 @@ LOGFILES=$(TEST_OUTPUTDIR)/log $(TEST_OUTPUTDIR)/longlog $(TEST_OUTPUTDIR)/faill
|
|||||||
LOGEXT=.testlog .tbslog .tbflog .webtbslog .webtbflog
|
LOGEXT=.testlog .tbslog .tbflog .webtbslog .webtbflog
|
||||||
|
|
||||||
# Subdirs available in the test subdir
|
# Subdirs available in the test subdir
|
||||||
TESTUNITDIRS=system dos crt objects strings sysutils math sharemem strutils matrix lineinfo ucomplex fpwidestring cpu fmtbcd windows classes character dateutil fpcunit softfpu variants sortbase sortalgs linux unixutil types nullable
|
TESTUNITDIRS=system dos crt objects strings sysutils math sharemem strutils matrix lineinfo ucomplex fpwidestring cpu fmtbcd windows classes character dateutil fpcunit softfpu variants sortbase sortalgs linux unixutil types nullable contnrs
|
||||||
TESTDIRECTDIRS=
|
TESTDIRECTDIRS=
|
||||||
TESTSUBDIRS=cg cg/variants cg/cdecl cpu16 cpu16/i8086 library opt $(addprefix units/,$(TESTUNITDIRS))
|
TESTSUBDIRS=cg cg/variants cg/cdecl cpu16 cpu16/i8086 library opt $(addprefix units/,$(TESTUNITDIRS))
|
||||||
TESTPACKAGESDIRS=win-base webtbs hash fcl-registry fcl-process zlib fcl-db fcl-xml cocoaint bzip2 fcl-net
|
TESTPACKAGESDIRS=win-base webtbs hash fcl-registry fcl-process zlib fcl-db fcl-xml cocoaint bzip2 fcl-net
|
||||||
|
8
tests/test/units/contnrs/tbucketlist.pp
Normal file
8
tests/test/units/contnrs/tbucketlist.pp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
program Project1;
|
||||||
|
uses contnrs;
|
||||||
|
var b:TBucketList;
|
||||||
|
begin
|
||||||
|
b:=TBucketList.Create();
|
||||||
|
b.Clear();
|
||||||
|
b.Add(nil,nil);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user