Ada: Protect against a predicate failure in VAST.
Adds a check to avoid a predicate failure in the VAST tree traversal.
A predicate failure could occur in the VAST (Very Abstract Syntax Tree) traversal if a node was not a Pragma as expected. This commit adds a check to ensure that aspect/pragma consistency is only verified for pragma nodes, preventing the predicate error and increasing compiler stability.
In Details
This commit modifies vast.adb within the GNAT compiler to add a check in Do_Node_Pass_2 before accessing fields of a node. This prevents a predicate failure that could occur if the node is not a Pragma as expected, improving the robustness of the VAST processing.
For Context
The Ada compiler transforms source code into a tree-like structure called the VAST (Very Abstract Syntax Tree). This tree is then processed by various compiler passes. This commit adds a check during one of these passes to make sure the code handles unexpected node types gracefully, preventing the compiler from crashing due to a 'predicate failure'.