* ch-exp.c (parse_tuple): Error if invalid mode.
This fixes PR chill/8870.
This commit is contained in:
parent
533bda7704
commit
9293e88698
2 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
Tue Jan 23 14:36:05 1996 Per Bothner <bothner@kalessin.cygnus.com>
|
||||
|
||||
* 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).
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue