mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +02:00
fcl-passrc: resolver: fixed uninitialized var
git-svn-id: trunk@39581 -
This commit is contained in:
parent
ada8891d9e
commit
971c7b45e7
@ -1742,6 +1742,7 @@ type
|
|||||||
function GetPasPropertyStoredExpr(El: TPasProperty): TPasExpr;
|
function GetPasPropertyStoredExpr(El: TPasProperty): TPasExpr;
|
||||||
function GetPasPropertyDefaultExpr(El: TPasProperty): TPasExpr;
|
function GetPasPropertyDefaultExpr(El: TPasProperty): TPasExpr;
|
||||||
function GetPasClassAncestor(ClassEl: TPasClassType; SkipAlias: boolean): TPasType;
|
function GetPasClassAncestor(ClassEl: TPasClassType; SkipAlias: boolean): TPasType;
|
||||||
|
function ProcHasImplElements(Proc: TPasProcedure): boolean; virtual;
|
||||||
function IndexOfImplementedInterface(ClassEl: TPasClassType; aType: TPasType): integer;
|
function IndexOfImplementedInterface(ClassEl: TPasClassType; aType: TPasType): integer;
|
||||||
function GetLoop(El: TPasElement): TPasImplElement;
|
function GetLoop(El: TPasElement): TPasImplElement;
|
||||||
function ResolveAliasType(aType: TPasType): TPasType;
|
function ResolveAliasType(aType: TPasType): TPasType;
|
||||||
@ -4200,7 +4201,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
ProcScope:=Proc.CustomData as TPasProcedureScope;
|
ProcScope:=Proc.CustomData as TPasProcedureScope;
|
||||||
if (ProcScope.ImplProc<>nil) // not abstract, external
|
if (ProcScope.ImplProc<>nil) // not abstract, external
|
||||||
and (GetProcFirstImplEl(ProcScope.ImplProc)=nil) then
|
and (not ProcHasImplElements(ProcScope.ImplProc)) then
|
||||||
// hidden method has implementation, but no statements -> useless
|
// hidden method has implementation, but no statements -> useless
|
||||||
// -> do not give a hint for hiding this useless method
|
// -> do not give a hint for hiding this useless method
|
||||||
// Note: if this happens in the same unit, the body was not yet parsed
|
// Note: if this happens in the same unit, the body was not yet parsed
|
||||||
@ -17494,17 +17495,20 @@ begin
|
|||||||
Result:=nil;
|
Result:=nil;
|
||||||
if Proc=nil then exit;
|
if Proc=nil then exit;
|
||||||
if Proc.Body<>nil then
|
if Proc.Body<>nil then
|
||||||
Body:=Proc.Body.Body;
|
Body:=Proc.Body.Body
|
||||||
|
else
|
||||||
|
Body:=nil;
|
||||||
if Body=nil then
|
if Body=nil then
|
||||||
begin
|
begin
|
||||||
if Proc.CustomData=nil then exit;
|
if Proc.CustomData=nil then exit;
|
||||||
Scope:=Proc.CustomData as TPasProcedureScope;
|
Scope:=Proc.CustomData as TPasProcedureScope;
|
||||||
if Scope.ImplProc=nil then exit;
|
|
||||||
Proc:=Scope.ImplProc;
|
Proc:=Scope.ImplProc;
|
||||||
if Proc.Body<>nil then
|
if Proc=nil then exit;
|
||||||
Body:=Proc.Body.Body;
|
if Proc.Body=nil then exit;
|
||||||
|
Body:=Proc.Body.Body;
|
||||||
if Body=nil then exit;
|
if Body=nil then exit;
|
||||||
end;
|
end;
|
||||||
|
if Body.Elements=nil then exit;
|
||||||
if Body.Elements.Count=0 then exit;
|
if Body.Elements.Count=0 then exit;
|
||||||
Result:=TPasImplElement(Body.Elements[0]);
|
Result:=TPasImplElement(Body.Elements[0]);
|
||||||
end;
|
end;
|
||||||
@ -19516,6 +19520,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPasResolver.ProcHasImplElements(Proc: TPasProcedure): boolean;
|
||||||
|
begin
|
||||||
|
Result:=GetProcFirstImplEl(Proc)<>nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TPasResolver.IndexOfImplementedInterface(ClassEl: TPasClassType;
|
function TPasResolver.IndexOfImplementedInterface(ClassEl: TPasClassType;
|
||||||
aType: TPasType): integer;
|
aType: TPasType): integer;
|
||||||
var
|
var
|
||||||
|
Loading…
Reference in New Issue
Block a user