From 6c994759f3581d979a57ce31cfab10cd5329bb44 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 22 Jun 2010 10:49:11 +0200 Subject: [multiple changes] 2010-06-22 Robert Dewar * sem_ch4.adb (Analyze_Conditional_Expression): Defend against malformed tree. * sprint.adb (Sprint_Node_Actual, case N_Conditional_Expression): Ditto. 2010-06-22 Arnaud Charlet * s-intman-vxworks.ads: Code clean up. 2010-06-22 Thomas Quinot * sem_res.adb (Resolve_Slice): When the prefix is an explicit dereference, construct actual subtype of designated object to generate proper bounds checks. 2010-06-22 Thomas Quinot * ali-util.adb, ali-util.ads, gnatbind.adb (Read_ALI): Rename to Read_Withed_ALIs, which is more descriptive. 2010-06-22 Pascal Obry * g-sothco.ads: Minor reformatting. * g-socthi-mingw.adb: Remove part of work on the C_Recvmsg and C_Sendmsg implementation. (C_Sendmsg): Do not use lock (not needed). (C_Recvmsg): Likewise and also do not wait for incoming data. From-SVN: r161148 --- gcc/ada/sprint.adb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'gcc/ada/sprint.adb') diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index b5e240c..4fff3f4 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -1251,14 +1251,20 @@ package body Sprint is declare Condition : constant Node_Id := First (Expressions (Node)); Then_Expr : constant Node_Id := Next (Condition); - Else_Expr : constant Node_Id := Next (Then_Expr); + begin Write_Str_With_Col_Check_Sloc ("(if "); Sprint_Node (Condition); Write_Str_With_Col_Check (" then "); - Sprint_Node (Then_Expr); - Write_Str_With_Col_Check (" else "); - Sprint_Node (Else_Expr); + + -- Defense against junk here! + + if Present (Then_Expr) then + Sprint_Node (Then_Expr); + Write_Str_With_Col_Check (" else "); + Sprint_Node (Next (Then_Expr)); + end if; + Write_Char (')'); end; -- cgit v1.1