mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 16:09:25 +02:00
* last commit was not complete, fixed
This commit is contained in:
parent
79f6ee538d
commit
7bbd33bcd6
@ -1361,14 +1361,23 @@ implementation
|
|||||||
case TStringConstNode(left).cst_type of
|
case TStringConstNode(left).cst_type of
|
||||||
cst_widestring, cst_unicodestring:
|
cst_widestring, cst_unicodestring:
|
||||||
{ value_str is of type PCompilerWideString }
|
{ value_str is of type PCompilerWideString }
|
||||||
|
|
||||||
|
{ while the conversion to PtrUInt is not correct when compiling from an 32 bit to a 64 bit platform because
|
||||||
|
in theory for a 64 bit target the string could be longer than 2^32,
|
||||||
|
it does not matter as a 32 bit host cannot handle such long strings anyways due to memory limitations
|
||||||
|
}
|
||||||
Result := COrdConstNode.create(
|
Result := COrdConstNode.create(
|
||||||
PCompilerWideString(TStringConstNode(left).value_str)^.data[AWord(TOrdConstNode(right).value.uvalue) - 1],
|
PCompilerWideString(TStringConstNode(left).value_str)^.data[PtrUInt(TOrdConstNode(right).value.uvalue) - 1],
|
||||||
resultdef,
|
resultdef,
|
||||||
False
|
False
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
|
{ while the conversion to PtrUInt is not correct when compiling from an 32 bit to a 64 bit platform because
|
||||||
|
in theory for a 64 bit target the string could be longer than 2^32,
|
||||||
|
it does not matter as a 32 bit host cannot handle such long strings anyways due to memory limitations
|
||||||
|
}
|
||||||
Result := COrdConstNode.create(
|
Result := COrdConstNode.create(
|
||||||
Byte(TStringConstNode(left).value_str[AWord(TOrdConstNode(right).value.uvalue) - 1]),
|
Byte(TStringConstNode(left).value_str[PtrUInt(TOrdConstNode(right).value.uvalue) - 1]),
|
||||||
resultdef,
|
resultdef,
|
||||||
False
|
False
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user