From 67acb289d70eeb619d978e9c9e1329e552e6825e Mon Sep 17 00:00:00 2001
From: ondrej <ondrej@idefix.freepascal.org>
Date: Sun, 9 Aug 2020 06:13:06 +0000
Subject: [PATCH] TWriter: fix default value handling for Int64/QWord values.
 Issue #37525

git-svn-id: trunk@46337 -
---
 rtl/objpas/classes/writer.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rtl/objpas/classes/writer.inc b/rtl/objpas/classes/writer.inc
index ac47559642..b7cb887a98 100644
--- a/rtl/objpas/classes/writer.inc
+++ b/rtl/objpas/classes/writer.inc
@@ -1171,8 +1171,8 @@ begin
         if HasAncestor then
           DefInt64Value := GetInt64Prop(Ancestor, PropInfo)
         else
-          DefInt64Value := 0;
-        if Int64Value <> DefInt64Value then
+          DefInt64Value := PPropInfo(PropInfo)^.Default;
+        if (Int64Value <> DefInt64Value) or (DefInt64Value=longint($80000000)) then
         begin
           Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);
           WriteInteger(Int64Value);