mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-29 19:51:22 +02:00
pastojs: fixed crash when parser error in inline specialize expression, issue 38111
This commit is contained in:
parent
40cd9a84c7
commit
5236a86500
@ -21056,6 +21056,7 @@ end;
|
|||||||
|
|
||||||
function TPasResolver.FindElementWithoutParams(const AName: String;
|
function TPasResolver.FindElementWithoutParams(const AName: String;
|
||||||
ErrorPosEl: TPasElement; NoProcsWithArgs, NoGenerics: boolean): TPasElement;
|
ErrorPosEl: TPasElement; NoProcsWithArgs, NoGenerics: boolean): TPasElement;
|
||||||
|
// ErrorPosEl=nil means to use scanner position as error position
|
||||||
var
|
var
|
||||||
Data: TPRFindData;
|
Data: TPRFindData;
|
||||||
begin
|
begin
|
||||||
@ -21070,6 +21071,7 @@ end;
|
|||||||
function TPasResolver.FindElementWithoutParams(const AName: String; out
|
function TPasResolver.FindElementWithoutParams(const AName: String; out
|
||||||
Data: TPRFindData; ErrorPosEl: TPasElement; NoProcsWithArgs,
|
Data: TPRFindData; ErrorPosEl: TPasElement; NoProcsWithArgs,
|
||||||
NoGenerics: boolean): TPasElement;
|
NoGenerics: boolean): TPasElement;
|
||||||
|
// ErrorPosEl=nil means to use scanner position as error position
|
||||||
var
|
var
|
||||||
Abort: boolean;
|
Abort: boolean;
|
||||||
begin
|
begin
|
||||||
|
@ -2152,7 +2152,7 @@ destructor TInlineSpecializeExpr.Destroy;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
TPasElement(NameExpr).Release{$IFDEF CheckPasTreeRefCount}('CreateElement'){$ENDIF};
|
ReleaseAndNil(TPasElement(NameExpr){$IFDEF CheckPasTreeRefCount},'CreateElement'{$ENDIF});
|
||||||
for i:=0 to Params.Count-1 do
|
for i:=0 to Params.Count-1 do
|
||||||
TPasElement(Params[i]).Release{$IFDEF CheckPasTreeRefCount}('TInlineSpecializeExpr.Params'){$ENDIF};
|
TPasElement(Params[i]).Release{$IFDEF CheckPasTreeRefCount}('TInlineSpecializeExpr.Params'){$ENDIF};
|
||||||
FreeAndNil(Params);
|
FreeAndNil(Params);
|
||||||
|
@ -1998,7 +1998,10 @@ begin
|
|||||||
finally
|
finally
|
||||||
if not ok then
|
if not ok then
|
||||||
if Result<>nil then
|
if Result<>nil then
|
||||||
|
begin
|
||||||
Result.Release{$IFDEF CheckPasTreeRefCount}('CreateElement'){$ENDIF};
|
Result.Release{$IFDEF CheckPasTreeRefCount}('CreateElement'){$ENDIF};
|
||||||
|
Result:=nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user