aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sprint.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-06-22 10:49:11 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-06-22 10:49:11 +0200
commit6c994759f3581d979a57ce31cfab10cd5329bb44 (patch)
tree213782122aa486f0afb1639800affca3d31088a3 /gcc/ada/sprint.adb
parent88b17d450602da928cabdfcbb324de8e76c4e8c4 (diff)
downloadgcc-6c994759f3581d979a57ce31cfab10cd5329bb44.zip
gcc-6c994759f3581d979a57ce31cfab10cd5329bb44.tar.gz
gcc-6c994759f3581d979a57ce31cfab10cd5329bb44.tar.bz2
[multiple changes]
2010-06-22 Robert Dewar <dewar@adacore.com> * 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 <charlet@adacore.com> * s-intman-vxworks.ads: Code clean up. 2010-06-22 Thomas Quinot <quinot@adacore.com> * 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 <quinot@adacore.com> * ali-util.adb, ali-util.ads, gnatbind.adb (Read_ALI): Rename to Read_Withed_ALIs, which is more descriptive. 2010-06-22 Pascal Obry <obry@adacore.com> * 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
Diffstat (limited to 'gcc/ada/sprint.adb')
-rw-r--r--gcc/ada/sprint.adb14
1 files changed, 10 insertions, 4 deletions
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;