View Issue Details

IDProjectCategoryView StatusLast Update
0036936LazarusLCLpublic2020-04-20 09:43
Reporternanobit Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformwin32OSWindows 
Product Version2.0.9 (SVN) 
Summary0036936: MakeLParam() rangechecking
DescriptionTwo issues come together with inlined MakeLParam():
1) FPC3.2 picks wrong version on signed input, unless called with unitname
2) LCL versions lack internal typecasting to suppress range-check errors
Steps To Reproduce{$R+}
uses windows, lclintf;
var x, y, param: longint;
begin
x := -2; y := -2;
// FPC correctly picks MakeLParam( longint, longint) version:
param := windows.MakeLParam( x, y); // qualified call works

// FPC picks winapi.inc.MakeLParam( word, word) version in all cases:
// ( but IDE MouseHint refers to windows.MakeLParam( longint, longint))
param := MakeLParam( x, y); // fails on word check
param := MakeLParam( longint(x), longint(y)); // the same as previous
param := MakeLParam( word(x), word(y)); // fails on dword check
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetWin32/Win64
Attached Files

Activities

nanobit

2020-04-20 09:43

reporter   ~0122266

"param := MakeLParam( word(x), word(y));"
I meant fails on longint-check: longint := dword

Issue History

Date Modified Username Field Change
2020-04-20 09:37 nanobit New Issue
2020-04-20 09:43 nanobit Note Added: 0122266