+2014-07-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/22434
+ PR c++/61288
+ * call.c (build_conditional_expr_1): Avoid reading freed memory.
+
2014-07-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53159
{
conversion *conv2;
conversion *conv3;
+ bool converted = false;
/* Get the high-water mark for the CONVERSION_OBSTACK. */
p = conversion_obstack_alloc (0);
converted to X, the conversion will fail. */
if (error_operand_p (arg2))
result = error_mark_node;
+ converted = true;
}
else if (conv3 && !conv3->bad_p)
{
arg3_type = TREE_TYPE (arg3);
if (error_operand_p (arg3))
result = error_mark_node;
+ converted = true;
}
/* Free all the conversions we allocated. */
conditional expression failing altogether, even though,
according to this step, the one operand could be converted to
the type of the other. */
- if (((conv2 && !conv2->bad_p)
- || (conv3 && !conv3->bad_p))
+ if (converted
&& CLASS_TYPE_P (arg2_type)
&& cp_type_quals (arg2_type) != cp_type_quals (arg3_type))
arg2_type = arg3_type =