* insert a type conversion if the final result of an queued expression is

different from the type of typed constant/initialised data

git-svn-id: branches/hlcgllvm@28146 -
This commit is contained in:
Jonas Maebe 2014-07-03 22:28:40 +00:00
parent ab186e8d75
commit fc7d5e2254

View File

@ -95,6 +95,12 @@ implementation
procedure tllvmtai_typedconstbuilder.update_queued_tai(resdef: tdef; outerai, innerai: tai; newindex: longint);
begin
{ is the result of the outermost expression different from the type of
this typed const? -> insert type conversion }
if not assigned(fqueued_tai) and
(resdef<>fqueued_def) and
(llvmencodetype(resdef)<>llvmencodetype(fqueued_def)) then
queue_typeconvn(resdef,fqueued_def);
if assigned(fqueued_tai) then
begin
taillvm(flast_added_tai).loadtai(fqueued_tai_opidx,outerai);