A code cleanup in routine intended to be used from DGB, suggested by running
GNATcheck rule Boolean_Negations. However, this code can be tuned to protect
against more illegal uses.
gcc/ada/ChangeLog:
* exp_disp.adb (Write_DT): Add guards that prevent crashes on illegal
node numbers.
begin
-- Protect this procedure against wrong usage. Required because it will
- -- be used directly from GDB
+ -- be used directly from GDB.
- if not (Typ <= Last_Node_Id)
+ if Typ not in First_Node_Id .. Last_Node_Id
+ or else Nkind (Typ) not in N_Entity
or else not Is_Tagged_Type (Typ)
then
Write_Str ("wrong usage: Write_DT must be used with tagged types");