mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-23 02:51:32 +02:00
* handle aligned assignments with size < sizeof(aint) properly, resolves #19355
git-svn-id: trunk@17468 -
This commit is contained in:
parent
54bbaa037e
commit
f1b13dca19
@ -567,6 +567,7 @@ implementation
|
||||
otlabel,hlabel,oflabel : tasmlabel;
|
||||
href : treference;
|
||||
releaseright : boolean;
|
||||
alignmentrequirement,
|
||||
len : aint;
|
||||
r : tregister;
|
||||
oldflowcontrol : tflowcontrol;
|
||||
@ -777,13 +778,17 @@ implementation
|
||||
{ TODO: HACK: unaligned test, maybe remove all unaligned locations (array of char) from the compiler}
|
||||
{ Use unaligned copy when the offset is not aligned }
|
||||
len:=left.resultdef.size;
|
||||
if (right.location.reference.offset mod sizeof(aint)<>0) or
|
||||
(left.location.reference.offset mod sizeof(aint)<>0) or
|
||||
(right.resultdef.alignment<sizeof(aint)) or
|
||||
|
||||
{ data smaller than an aint has less alignment requirements }
|
||||
alignmentrequirement:=min(len,sizeof(aint));
|
||||
|
||||
if (right.location.reference.offset mod alignmentrequirement<>0) or
|
||||
(left.location.reference.offset mod alignmentrequirement<>0) or
|
||||
(right.resultdef.alignment<alignmentrequirement) or
|
||||
((right.location.reference.alignment<>0) and
|
||||
(right.location.reference.alignment<sizeof(aint))) or
|
||||
(right.location.reference.alignment<alignmentrequirement)) or
|
||||
((left.location.reference.alignment<>0) and
|
||||
(left.location.reference.alignment<sizeof(aint))) then
|
||||
(left.location.reference.alignment<alignmentrequirement)) then
|
||||
cg.g_concatcopy_unaligned(current_asmdata.CurrAsmList,right.location.reference,left.location.reference,len)
|
||||
else
|
||||
cg.g_concatcopy(current_asmdata.CurrAsmList,right.location.reference,left.location.reference,len);
|
||||
|
Loading…
Reference in New Issue
Block a user