mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +02:00
* fixed val when the 'code' parameter is the same size as the native CPU int type, but unsigned
git-svn-id: branches/i8086@23859 -
This commit is contained in:
parent
b178a038f5
commit
573ea10ef3
@ -1380,11 +1380,12 @@ implementation
|
|||||||
{ we need its resultdef later on }
|
{ we need its resultdef later on }
|
||||||
codepara.get_paratype;
|
codepara.get_paratype;
|
||||||
end
|
end
|
||||||
else if (torddef(codepara.resultdef).ordtype = torddef(ptrsinttype).ordtype) then
|
else if (torddef(codepara.resultdef).ordtype <> torddef(ptrsinttype).ordtype) then
|
||||||
{ because code is a var parameter, it must match types exactly }
|
{ because code is a var parameter, it must match types exactly }
|
||||||
{ however, since it will return values in [0..255], both longints }
|
{ however, since it will return values >= 0, both signed and }
|
||||||
{ and cardinals are fine. Since the formal code para type is }
|
{ and unsigned ints of the same size are fine. Since the formal }
|
||||||
{ longint, insert a typecoversion to longint for cardinal para's }
|
{ code para type is sinttype, insert a typecoversion to sint for }
|
||||||
|
{ unsigned para's }
|
||||||
begin
|
begin
|
||||||
codepara.left := ctypeconvnode.create_internal(codepara.left,ptrsinttype);
|
codepara.left := ctypeconvnode.create_internal(codepara.left,ptrsinttype);
|
||||||
{ make it explicit, oterwise you may get a nonsense range }
|
{ make it explicit, oterwise you may get a nonsense range }
|
||||||
|
Loading…
Reference in New Issue
Block a user