From: Bob Duff Date: Fri, 15 May 2020 15:40:50 +0000 (-0400) Subject: [Ada] Avoid crash on node extension X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e997d94b298c5ea753b613c38518a2c72bdf44af;p=gcc.git [Ada] Avoid crash on node extension gcc/ada/ * treepr.adb (Print_Node): Add code to test Is_Extension. --- diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb index b84af01d40f..b4fd5456165 100644 --- a/gcc/ada/treepr.adb +++ b/gcc/ada/treepr.adb @@ -1006,6 +1006,15 @@ package body Treepr is return; end if; + -- Similarly, if N points to an extension, avoid crashing + + if Atree_Private_Part.Nodes.Table (N).Is_Extension then + Print_Int (Int (N)); + Print_Str (" is an extension, not a node"); + Print_Eol; + return; + end if; + Prefix_Str_Char (Prefix_Str'Range) := Prefix_Str; Prefix_Str_Char (Prefix_Str'Last + 1) := Prefix_Char;