From 9293e88698823b6ea4a43fc0cea53cc2d34b53f3 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Wed, 24 Jan 1996 00:50:11 +0000 Subject: [PATCH] * ch-exp.c (parse_tuple): Error if invalid mode. This fixes PR chill/8870. --- gdb/ChangeLog | 2 ++ gdb/ch-exp.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 50aaf96b29..7f771cea23 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ Tue Jan 23 14:36:05 1996 Per Bothner + * ch-exp.c (parse_tuple): Error if invalid mode. + * value.h (COERCE_ARRAY): Don't coerce enums. (COERCE_ENUM): Don't COERCE_REF. (COERCE_NUMBER): New macro (same as COERCE_ARRAY then COERCE_ENUM). diff --git a/gdb/ch-exp.c b/gdb/ch-exp.c index 492f3765a7..95021e7ca7 100644 --- a/gdb/ch-exp.c +++ b/gdb/ch-exp.c @@ -579,6 +579,11 @@ parse_tuple (mode) write_exp_elt_opcode (OP_ARRAY); if (mode) { + struct type *type = check_typedef (mode); + if (TYPE_CODE (type) != TYPE_CODE_ARRAY + && TYPE_CODE (type) != TYPE_CODE_STRUCT + && TYPE_CODE (type) != TYPE_CODE_SET) + error ("invalid tuple mode"); write_exp_elt_opcode (UNOP_CAST); write_exp_elt_type (mode); write_exp_elt_opcode (UNOP_CAST); -- 2.34.1