MakeLParam() rangechecking
Original Reporter info from Mantis: nanobit @nanobit
-
Reporter name:
Original Reporter info from Mantis: nanobit @nanobit
- Reporter name:
Description:
Two issues come together with inlined MakeLParam():
- FPC3.2 picks wrong version on signed input, unless called with unitname
- 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
Mantis conversion info:
- Mantis ID: 36936
- OS: Windows
- OS Build: 10
- Platform: win32
- Version: 2.0.9 (SVN)