mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-06-13 11:29:30 +00:00
Initialize arrays from strings with a pc_mov operation.
This is smaller and more efficient than the previous code that called memcpy(). It also avoids a theoretical issue if the user's code included an incompatible definition of memcpy.
This commit is contained in:
parent
0c4660d5fc
commit
a7d9d3039b
11
Parser.pas
11
Parser.pas
|
@ -4621,15 +4621,10 @@ var
|
||||||
else
|
else
|
||||||
size := size-1;
|
size := size-1;
|
||||||
if size <> 0 then begin
|
if size <> 0 then begin
|
||||||
GenLdcLong(size);
|
|
||||||
Gen0t(pc_stk, cgULong);
|
|
||||||
GenS(pc_lca, iPtr^.iTree^.token.sval);
|
|
||||||
Gen0t(pc_stk, cgULong);
|
|
||||||
Gen0t(pc_bno, cgULong);
|
|
||||||
LoadAddress;
|
LoadAddress;
|
||||||
Gen0t(pc_stk, cgULong);
|
GenS(pc_lca, iPtr^.iTree^.token.sval);
|
||||||
Gen0t(pc_bno, cgULong);
|
Gen2(pc_mov, 0, size);
|
||||||
Gen1tName(pc_cup, 0, cgVoid, @'memcpy');
|
Gen0t(pc_pop, cgULong);
|
||||||
if isCompoundLiteral then
|
if isCompoundLiteral then
|
||||||
AddOperation;
|
AddOperation;
|
||||||
end; {if}
|
end; {if}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user