In some cases, the inlining performed in GNATprove mode leads to a crash,
when inlining a call where a return statement of the inlined function
returns a string literal. Now fixed.
2018-05-21 Yannick Moy <moy@adacore.com>
gcc/ada/
* sem_eval.adb (Static_Length): Take into account case of variable of
subtype string literal.
From-SVN: r260452
+2018-04-04 Yannick Moy <moy@adacore.com>
+
+ * sem_eval.adb (Static_Length): Take into account case of variable of
+ subtype string literal.
+
2018-04-04 Olivier Hainque <hainque@adacore.com>
* libgnat/s-objrea.ads (Get_Memory_Bounds): Rename as Get_Xcode_Bounds.
if Nkind (Expr) = N_String_Literal then
return UI_From_Int (String_Length (Strval (Expr)));
+ -- With frontend inlining as performed in GNATprove mode, a variable
+ -- may be inserted that has a string literal subtype. Deal with this
+ -- specially as for the previous case.
+
+ elsif Ekind (Etype (Expr)) = E_String_Literal_Subtype then
+ return String_Literal_Length (Etype (Expr));
+
-- Second easy case, not constrained subtype, so no length
elsif not Is_Constrained (Etype (Expr)) then