View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037772 | FPC | Free Vision | public | 2020-09-18 18:07 | 2020-09-18 21:29 |
Reporter | Joe care | Assigned To | Florian | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | x86-64 | OS | Win64 | ||
Product Version | 3.3.1 | ||||
Fixed in Version | 3.3.1 | ||||
Summary | 0037772: Pointer-conversion to longint might fail in x64-bit environment. | ||||
Description | On 2(3) places in Free Vision a pointer is converted to longint this might fail in x64-bit environments (even when it's very unlikely.) even converting an Pointer to PtrInt might be safe but gives warning about signed/unsigned comparison. | ||||
Additional Information | replaced longint with PtrUInt ... Patch provited | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 46893 | ||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
fv_src.patch (2,214 bytes)
Index: drivers.pas =================================================================== --- drivers.pas (Revision 46892) +++ drivers.pas (Arbeitskopie) @@ -1375,7 +1375,7 @@ GetVideoMode(ScreenMode); end; - if ScreenWidth > MaxViewWidth then + if ScreenWidth >= MaxViewWidth then ScreenWidth := MaxViewWidth; ScreenWidth:=Video.ScreenWidth; ScreenHeight:=Video.ScreenHeight; Index: sysmsg.pas =================================================================== --- sysmsg.pas (Revision 46892) +++ sysmsg.pas (Arbeitskopie) @@ -104,7 +104,7 @@ begin PendingSystemTail^:=SystemEvent; inc(PendingSystemTail); - if longint(PendingSystemTail)=longint(@PendingSystemEvent)+sizeof(PendingSystemEvent) then + if PtrUInt(PendingSystemTail)=PtrUInt(@PendingSystemEvent)+sizeof(PendingSystemEvent) then PendingSystemTail:=@PendingSystemEvent; inc(PendingSystemEvents); end; Index: views.pas =================================================================== --- views.pas (Revision 46892) +++ views.pas (Arbeitskopie) @@ -2117,7 +2117,7 @@ Tp := Last; { Set temporary ptr } Repeat Tp := Tp^.Next; { Get next view } - IF Byte(Longint(CallPointerMethodLocal(TCallbackFunBoolParam(P), + IF Byte(PtrUInt(CallPointerMethodLocal(TCallbackFunBoolParam(P), { On most systems, locals are accessed relative to base pointer, but for MIPS cpu, they are accessed relative to stack pointer. This needs adaptation for so low level routines, Index: w32smsg.inc =================================================================== --- w32smsg.inc (Revision 46892) +++ w32smsg.inc (Arbeitskopie) @@ -145,7 +145,7 @@ EnterCriticalSection(ChangeSystemEvents); SystemEvent:=PendingSystemHead^; inc(PendingSystemHead); - if ptrint(PendingSystemHead)=ptrint(@PendingSystemEvent)+sizeof(PendingSystemEvent) then + if PtrUInt(PendingSystemHead)=PtrUInt(@PendingSystemEvent)+sizeof(PendingSystemEvent) then PendingSystemHead:=@PendingSystemEvent; dec(PendingSystemEvents); LastSystemEvent:=SystemEvent; |
|
Thanks, applied (without the unrelated change to drivers.pas). |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-09-18 18:07 | Joe care | New Issue | |
2020-09-18 18:07 | Joe care | File Added: fv_src.patch | |
2020-09-18 21:29 | Florian | Assigned To | => Florian |
2020-09-18 21:29 | Florian | Status | new => resolved |
2020-09-18 21:29 | Florian | Resolution | open => fixed |
2020-09-18 21:29 | Florian | Fixed in Version | => 3.3.1 |
2020-09-18 21:29 | Florian | Fixed in Revision | => 46893 |
2020-09-18 21:29 | Florian | FPCTarget | => - |
2020-09-18 21:29 | Florian | Note Added: 0125630 |