diff --git a/tests/webtbs/tw40077.pp b/tests/webtbs/tw40077.pp new file mode 100644 index 0000000000..14cb9497d7 --- /dev/null +++ b/tests/webtbs/tw40077.pp @@ -0,0 +1,23 @@ +program tw40077; +uses + Generics.Collections, Generics.Defaults; + +type + TRec = record + X: Int64; + Y: Int64; + end; + TDict = specialize TObjectDictionary; + +var + Dict: TDict; + R: TRec; +begin + Dict := TDict.Create([doOwnsValues]); + R.X := 1; + R.Y := 1; + if not Dict.ContainsKey(R) then // <---------- SIGSEGV here + Dict.Add(R, TObject.Create); + Dict.Free; +end. +