瀏覽代碼

GetInt64Prop: return unsigned value for ULong

Ondrej Pokorny 1 月之前
父節點
當前提交
8d6b823d4e
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      rtl/objpas/typinfo.pp

+ 11 - 0
rtl/objpas/typinfo.pp

@@ -3088,8 +3088,19 @@ end;
   ---------------------------------------------------------------------}
 
 Function GetInt64Prop(Instance: TObject; PropInfo: PPropInfo): Int64;
+var
+  TypeInfo: PTypeInfo;
+  OrdType: TOrdType;
 begin
   Result:=GetOrdProp(Instance,PropInfo);
+  // GetOrdProp returns a signed value for ULong -> it must be made unsigned (Delphi compatibility)
+  TypeInfo := PropInfo^.PropType;
+  if TypeInfo^.Kind=tkInteger then
+  begin
+    OrdType:=GetTypeData(TypeInfo)^.OrdType;
+    if OrdType=otULong then
+      Result:=UInt32(Result);
+  end;
 end;