mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 23:50:23 +02:00
* dom.pp: fixed one possible reason of crashing in Delphi 2009
* xmlutils.pp: clean up git-svn-id: trunk@13604 -
This commit is contained in:
parent
f853ac4c63
commit
e9e6439345
@ -3217,7 +3217,7 @@ begin
|
|||||||
if Pointer(FCurrBlock) = Pointer(FCurrExtent) + sizeof(TExtent) then
|
if Pointer(FCurrBlock) = Pointer(FCurrExtent) + sizeof(TExtent) then
|
||||||
AddExtent(FCurrExtentSize * 2);
|
AddExtent(FCurrExtentSize * 2);
|
||||||
Result := FCurrBlock;
|
Result := FCurrBlock;
|
||||||
Dec(PChar(FCurrBlock), FElementSize);
|
Dec(PAnsiChar(FCurrBlock), FElementSize);
|
||||||
end;
|
end;
|
||||||
AClass.InitInstance(Result);
|
AClass.InitInstance(Result);
|
||||||
Result.FPool := Self; // mark as used
|
Result.FPool := Self; // mark as used
|
||||||
|
@ -55,7 +55,7 @@ type
|
|||||||
FBucketCount: LongWord;
|
FBucketCount: LongWord;
|
||||||
FBucket: PPHashItem;
|
FBucket: PPHashItem;
|
||||||
FOwnsObjects: Boolean;
|
FOwnsObjects: Boolean;
|
||||||
function Lookup(Key: PWideChar; KeyLength: Integer; var Found: Boolean; CanCreate: Boolean): PHashItem;
|
function Lookup(Key: PWideChar; KeyLength: Integer; out Found: Boolean; CanCreate: Boolean): PHashItem;
|
||||||
procedure Resize(NewCapacity: LongWord);
|
procedure Resize(NewCapacity: LongWord);
|
||||||
public
|
public
|
||||||
constructor Create(InitSize: Integer; OwnObjects: Boolean);
|
constructor Create(InitSize: Integer; OwnObjects: Boolean);
|
||||||
@ -73,7 +73,6 @@ type
|
|||||||
|
|
||||||
{ another hash, for detecting duplicate namespaced attributes without memory allocations }
|
{ another hash, for detecting duplicate namespaced attributes without memory allocations }
|
||||||
|
|
||||||
PWideString = ^WideString;
|
|
||||||
PExpHashEntry = ^TExpHashEntry;
|
PExpHashEntry = ^TExpHashEntry;
|
||||||
TExpHashEntry = record
|
TExpHashEntry = record
|
||||||
rev: LongWord;
|
rev: LongWord;
|
||||||
@ -129,7 +128,7 @@ begin
|
|||||||
Result := Xml11Pg;
|
Result := Xml11Pg;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsXml11Char(Value: PWideChar; var Index: Integer): Boolean; overload;
|
function IsXml11Char(Value: PWideChar; var Index: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
if (Value[Index] >= #$D800) and (Value[Index] <= #$DB7F) then
|
if (Value[Index] >= #$D800) and (Value[Index] <= #$DB7F) then
|
||||||
begin
|
begin
|
||||||
@ -140,7 +139,7 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsXml11Char(const Value: WideString; var Index: Integer): Boolean; overload;
|
function IsXml11Char(const Value: WideString; var Index: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
if (Value[Index] >= #$D800) and (Value[Index] <= #$DB7F) then
|
if (Value[Index] >= #$D800) and (Value[Index] <= #$DB7F) then
|
||||||
begin
|
begin
|
||||||
@ -156,7 +155,7 @@ begin
|
|||||||
Result := IsXmlName(PWideChar(Value), Length(Value), Xml11);
|
Result := IsXmlName(PWideChar(Value), Length(Value), Xml11);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function IsXmlName(Value: PWideChar; Len: Integer; Xml11: Boolean = False): Boolean; overload;
|
function IsXmlName(Value: PWideChar; Len: Integer; Xml11: Boolean = False): Boolean;
|
||||||
var
|
var
|
||||||
Pages: PByteArray;
|
Pages: PByteArray;
|
||||||
I: Integer;
|
I: Integer;
|
||||||
@ -424,7 +423,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function THashTable.Lookup(Key: PWideChar; KeyLength: Integer;
|
function THashTable.Lookup(Key: PWideChar; KeyLength: Integer;
|
||||||
var Found: Boolean; CanCreate: Boolean): PHashItem;
|
out Found: Boolean; CanCreate: Boolean): PHashItem;
|
||||||
var
|
var
|
||||||
Entry: PPHashItem;
|
Entry: PPHashItem;
|
||||||
h: LongWord;
|
h: LongWord;
|
||||||
|
Loading…
Reference in New Issue
Block a user