mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 09:29:35 +02: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);
|
||||
var
|
||||
valuedef: tdef;
|
||||
begin
|
||||
{ no offset into an ordinal constant }
|
||||
if fqueue_offset<>0 then
|
||||
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;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user