[D] Fix crash when debug expression enabled.
[deliverable/binutils-gdb.git] / gdb / d-exp.y
index 077e645dec2bdd53954ff734d7c4a76a7a1aa8aa..b5265754ed0468537105ecc8ac486e551a54b3e6 100644 (file)
@@ -321,15 +321,12 @@ UnaryExpression:
 
 CastExpression:
        CAST_KEYWORD '(' TypeExp ')' UnaryExpression
-               { write_exp_elt_opcode (pstate, UNOP_CAST);
-                 write_exp_elt_type (pstate, $3);
-                 write_exp_elt_opcode (pstate, UNOP_CAST); }
+               { write_exp_elt_opcode (pstate, UNOP_CAST_TYPE); }
        /* C style cast is illegal D, but is still recognised in
           the grammar, so we keep this around for convenience.  */
 |      '(' TypeExp ')' UnaryExpression
-               { write_exp_elt_opcode (pstate, UNOP_CAST);
-                 write_exp_elt_type (pstate, $2);
-                 write_exp_elt_opcode (pstate, UNOP_CAST); }
+               { write_exp_elt_opcode (pstate, UNOP_CAST_TYPE); }
+
 ;
 
 PowExpression:
This page took 0.054643 seconds and 4 git commands to generate.