소스 검색

Fix for the make function from TValue don't change the value from the record prototype.

Henrique Gottardi Werlang 9 달 전
부모
커밋
e7e9f1c359
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      packages/rtl/src/rtti.pas

+ 5 - 3
packages/rtl/src/rtti.pas

@@ -858,10 +858,12 @@ begin
   Result.FTypeInfo := ATypeInfo;
 
   if Result.FTypeInfo.Kind = tkRecord then
+  begin
+    Result.FData := TTypeInfoRecord(ATypeInfo).RecordInfo.New;
+
     if Assigned(ABuffer) then
-      Result.FData := TTypeInfoRecord(ATypeInfo).RecordInfo.Assign(ABuffer)
-    else
-      Result.FData := TTypeInfoRecord(ATypeInfo).RecordInfo.New
+      TRecordInfo(Result.FData).Assign(ABuffer);
+  end
   else
     Result.FData := ABuffer;
 end;