mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 11:58:12 +02:00
FpDebugger (all): prevent nil deref, for empty watch (auto instance class)
git-svn-id: trunk@62811 -
This commit is contained in:
parent
1f69cf465e
commit
667546f298
@ -2327,6 +2327,13 @@ begin
|
||||
FPrettyPrinter.MemManager := AContext.MemManager;
|
||||
|
||||
ResValue := APasExpr.ResultValue;
|
||||
if ResValue = nil then begin
|
||||
AResText := 'Error';
|
||||
if AWatchValue <> nil then
|
||||
AWatchValue.Validity := ddsInvalid;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if (ResValue.Kind = skClass) and (ResValue.AsCardinal <> 0) and (defClassAutoCast in EvalFlags)
|
||||
then begin
|
||||
CastName := '';
|
||||
|
@ -1048,6 +1048,12 @@ DebugLn(DBG_VERBOSE, [ErrorHandler.ErrorAsString(PasExpr.Error)]);
|
||||
if not IsWatchValueAlive then exit;
|
||||
|
||||
ResValue := PasExpr.ResultValue;
|
||||
if ResValue = nil then begin
|
||||
AResText := 'Error';
|
||||
if AWatchValue <> nil then
|
||||
AWatchValue.Validity := ddsInvalid;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if (ResValue.Kind = skClass) and (ResValue.AsCardinal <> 0) and (defClassAutoCast in EvalFlags)
|
||||
then begin
|
||||
|
@ -1491,6 +1491,12 @@ DebugLn(DBG_VERBOSE, [ErrorHandler.ErrorAsString(PasExpr.Error)]);
|
||||
if not IsWatchValueAlive then exit;
|
||||
|
||||
ResValue := PasExpr.ResultValue;
|
||||
if ResValue = nil then begin
|
||||
AResText := 'Error';
|
||||
if AWatchValue <> nil then
|
||||
AWatchValue.Validity := ddsInvalid;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if (ResValue.Kind = skClass) and (ResValue.AsCardinal <> 0) and (defClassAutoCast in EvalFlags)
|
||||
then begin
|
||||
|
Loading…
Reference in New Issue
Block a user