mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 13:39:26 +02:00
* free the placeholder for the count of the dynamic array in end_dynarray_const() and document it as such
This commit is contained in:
parent
54dccaaad1
commit
1180589046
@ -359,6 +359,7 @@ type
|
|||||||
procedure emit_dynarray_offset(const ll:tasmlabofs;const arrlength:asizeint;const arrdef:tarraydef; const arrconstdatadef: trecorddef);virtual;
|
procedure emit_dynarray_offset(const ll:tasmlabofs;const arrlength:asizeint;const arrdef:tarraydef; const arrconstdatadef: trecorddef);virtual;
|
||||||
{ starts a dynamic array constant so that its data can be emitted directly afterwards }
|
{ starts a dynamic array constant so that its data can be emitted directly afterwards }
|
||||||
function begin_dynarray_const(arrdef:tdef;var startlab:tasmlabel;out arrlengthloc:ttypedconstplaceholder):tasmlabofs;virtual;
|
function begin_dynarray_const(arrdef:tdef;var startlab:tasmlabel;out arrlengthloc:ttypedconstplaceholder):tasmlabofs;virtual;
|
||||||
|
{ ends a dynamic array constant by updating the count field; the arrlengthloc will be freed }
|
||||||
function end_dynarray_const(arrdef:tdef;arrlength:asizeint;arrlengthloc:ttypedconstplaceholder):tdef;virtual;
|
function end_dynarray_const(arrdef:tdef;arrlength:asizeint;arrlengthloc:ttypedconstplaceholder):tdef;virtual;
|
||||||
|
|
||||||
{ emit a shortstring constant, and return its def }
|
{ emit a shortstring constant, and return its def }
|
||||||
@ -1803,6 +1804,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
{ we emit the high value, not the count }
|
{ we emit the high value, not the count }
|
||||||
arrlengthloc.replace(tai_const.Create_sizeint(arrlength-1),sizesinttype);
|
arrlengthloc.replace(tai_const.Create_sizeint(arrlength-1),sizesinttype);
|
||||||
|
arrlengthloc.free;
|
||||||
result:=end_anonymous_record;
|
result:=end_anonymous_record;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user