mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-22 12:19:28 +01:00
* fixed typed constants that use an integer number to initialise a procvar or
pointer on LLVM (fixes webtbs/tw21267) git-svn-id: trunk@35059 -
This commit is contained in:
parent
2e9c6f35ae
commit
a0b537bc7b
@ -757,10 +757,21 @@ implementation
|
|||||||
|
|
||||||
|
|
||||||
procedure tllvmtai_typedconstbuilder.queue_emit_ordconst(value: int64; def: tdef);
|
procedure tllvmtai_typedconstbuilder.queue_emit_ordconst(value: int64; def: tdef);
|
||||||
|
var
|
||||||
|
valuedef: tdef;
|
||||||
begin
|
begin
|
||||||
{ no offset into an ordinal constant }
|
{ no offset into an ordinal constant }
|
||||||
if fqueue_offset<>0 then
|
if fqueue_offset<>0 then
|
||||||
internalerror(2015030702);
|
internalerror(2015030702);
|
||||||
|
if not is_ordinal(def) then
|
||||||
|
begin
|
||||||
|
{ insert an ordinal -> non-ordinal (e.g. pointer) conversion, as you
|
||||||
|
cannot have integer constants as pointer values in LLVM }
|
||||||
|
int_to_type(value,valuedef);
|
||||||
|
queue_typeconvn(valuedef,def);
|
||||||
|
{ and now emit the constant as an ordinal }
|
||||||
|
def:=valuedef;
|
||||||
|
end;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user