Browse Source

* fix compilation on i8086 where depending on the memory type code and data pointers may be different (Note: this does not mean that the code works as the RTTI data generated by the compiler does not seem valid either)

Sven/Sarah Barth 7 months ago
parent
commit
4aed151833
1 changed files with 5 additions and 0 deletions
  1. 5 0
      packages/rtl-objpas/src/inc/rtti.pp

+ 5 - 0
packages/rtl-objpas/src/inc/rtti.pp

@@ -7390,7 +7390,12 @@ var
 begin
 begin
   case (FPropInfo^.PropProcs shr 2) and 3 of
   case (FPropInfo^.PropProcs shr 2) and 3 of
     ptField:
     ptField:
+      {$ifdef cpu8086}
+      { convert to the correct pointer type }
+      AValue.Cast(FPropInfo^.PropType).ExtractRawData(PPointer(@(FPropInfo^.SetProc))^);
+      {$else}
       AValue.Cast(FPropInfo^.PropType).ExtractRawData(FPropInfo^.SetProc);
       AValue.Cast(FPropInfo^.PropType).ExtractRawData(FPropInfo^.SetProc);
+      {$endif}
     ptStatic,
     ptStatic,
     ptVirtual:
     ptVirtual:
       begin
       begin