FpDebug: fix incorrect class typecasts

This commit is contained in:
Martin 2024-07-25 21:02:35 +02:00
parent da812e6d12
commit be343003c0

View File

@ -366,7 +366,7 @@ begin
exit; exit;
// Only AnsiStrings in fpc 3.0.0 and higher have a dynamic codepage. // Only AnsiStrings in fpc 3.0.0 and higher have a dynamic codepage.
v := TFpDwarfFreePascalSymbolClassMapDwarf3(TypeInfo.CompilationUnit.DwarfSymbolClassMap).FCompilerVersion; v := TFpDwarfFreePascalSymbolClassMap(TypeInfo.CompilationUnit.DwarfSymbolClassMap).FCompilerVersion;
if (v >= $030000) then begin if (v >= $030000) then begin
// Too bad the debug-information does not deliver this information. So we // Too bad the debug-information does not deliver this information. So we
// use these hardcoded information, and hope that FPC does not change and // use these hardcoded information, and hope that FPC does not change and
@ -2268,8 +2268,8 @@ begin
exit; exit;
assert((TypeInfo <> nil) and (TypeInfo.CompilationUnit <> nil) and (TypeInfo.CompilationUnit.DwarfSymbolClassMap is TFpDwarfFreePascalSymbolClassMapDwarf3), 'TFpValueDwarfV3FreePascalString.CalcBounds: (Owner <> nil) and (Owner.CompilationUnit <> nil) and (TypeInfo.CompilationUnit.DwarfSymbolClassMap is TFpDwarfFreePascalSymbolClassMapDwarf3)'); assert((TypeInfo <> nil) and (TypeInfo.CompilationUnit <> nil) and (TypeInfo.CompilationUnit.DwarfSymbolClassMap is TFpDwarfFreePascalSymbolClassMapDwarf3), 'TFpValueDwarfV3FreePascalString.CalcBounds: (Owner <> nil) and (Owner.CompilationUnit <> nil) and (TypeInfo.CompilationUnit.DwarfSymbolClassMap is TFpDwarfFreePascalSymbolClassMapDwarf3)');
if (TFpDwarfFreePascalSymbolClassMapDwarf3(TypeInfo.CompilationUnit.DwarfSymbolClassMap).FCompilerVersion > 0) and if (TFpDwarfFreePascalSymbolClassMap(TypeInfo.CompilationUnit.DwarfSymbolClassMap).FCompilerVersion > 0) and
(TFpDwarfFreePascalSymbolClassMapDwarf3(TypeInfo.CompilationUnit.DwarfSymbolClassMap).FCompilerVersion < $030100) (TFpDwarfFreePascalSymbolClassMap(TypeInfo.CompilationUnit.DwarfSymbolClassMap).FCompilerVersion < $030100)
then begin then begin
if t.Kind = skWideString then begin if t.Kind = skWideString then begin
if (t2 is TFpSymbolDwarfTypeSubRange) and (FLowBound = 1) then begin if (t2 is TFpSymbolDwarfTypeSubRange) and (FLowBound = 1) then begin