Tobias Giesen via fpc-pascal
2021-05-30 13:47:35 UTC
Hello,
it seems that the newest 32-bit FPC sometimes creates complete Boolean Evaluation
rather than partial, which causes my application to crash. My context is like this:
type BOOL=LongBool;
PBOOL=^LongBool;
function DoSomething(const Cancel:PBOOL=nil);
begin
if Assigned(Cancel) and Cancel^ then
Exit;
end;
This crashes because Cancel and Cancel^ are always evaluated, even if Cancel is nil.
It works fine in 64-bit.
Is this a known problem?
Cheers,
Tobias
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal.org/cgi-b
it seems that the newest 32-bit FPC sometimes creates complete Boolean Evaluation
rather than partial, which causes my application to crash. My context is like this:
type BOOL=LongBool;
PBOOL=^LongBool;
function DoSomething(const Cancel:PBOOL=nil);
begin
if Assigned(Cancel) and Cancel^ then
Exit;
end;
This crashes because Cancel and Cancel^ are always evaluated, even if Cancel is nil.
It works fine in 64-bit.
Is this a known problem?
Cheers,
Tobias
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal.org/cgi-b