mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 23:19:24 +02:00
* assume that dynamic arrays with a negative reference count are immutable (at least regarding their metadata)
git-svn-id: trunk@39037 -
This commit is contained in:
parent
c8cbb1daea
commit
8606293028
@ -88,7 +88,7 @@ procedure fpc_dynarray_clear(var p : pointer;ti : pointer); [Public,Alias:'FPC_D
|
||||
if realp^.refcount=0 then
|
||||
HandleErrorAddrFrameInd(204,get_pc_addr,get_frame);
|
||||
|
||||
if declocked(realp^.refcount) then
|
||||
if (realp^.refcount>0) and declocked(realp^.refcount) then
|
||||
begin
|
||||
{$ifdef VER3_0}
|
||||
ti:=aligntoptr(ti+2+PByte(ti)[1]);
|
||||
@ -115,9 +115,9 @@ procedure fpc_dynarray_incr_ref(p : pointer);[Public,Alias:'FPC_DYNARRAY_INCR_RE
|
||||
|
||||
realp:=pdynarray(p-sizeof(tdynarray));
|
||||
if realp^.refcount=0 then
|
||||
HandleErrorAddrFrameInd(204,get_pc_addr,get_frame);
|
||||
|
||||
inclocked(realp^.refcount);
|
||||
HandleErrorAddrFrameInd(204,get_pc_addr,get_frame)
|
||||
else if realp^.refcount>0 then
|
||||
inclocked(realp^.refcount);
|
||||
end;
|
||||
|
||||
{ provide local access to dynarr_decr_ref for dynarr_setlength }
|
||||
|
Loading…
Reference in New Issue
Block a user