Commit c71a55f8 by Marek Polacek Committed by Marek Polacek

re PR sanitizer/63690 (ICE: tree check: expected class 'expression', have…

re PR sanitizer/63690 (ICE: tree check: expected class 'expression', have 'constant' (string_cst) with -fsanitize=undefined)

	PR sanitizer/63690
	* ubsan.c (instrument_object_size): Check for MEM_REF.

	* gcc.dg/ubsan/pr63690.c: New test.

From-SVN: r217778
parent 3b5b7762
2014-11-19 Marek Polacek <polacek@redhat.com>
PR sanitizer/63690
* ubsan.c (instrument_object_size): Check for MEM_REF.
2014-11-19 Ilya Verbin <ilya.verbin@intel.com>
PR regression/63868
2014-11-19 Marek Polacek <polacek@redhat.com>
PR sanitizer/63690
* gcc.dg/ubsan/pr63690.c: New test.
2014-11-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR sanitizer/62132
......
/* PR sanitizer/63690 */
/* { dg-do compile } */
/* { dg-options "-fsanitize=undefined" } */
void
foo (void)
{
(*"c")++;
}
/* PR sanitizer/63690 */
/* { dg-do compile } */
/* { dg-options "-fsanitize=undefined" } */
void
foo (void)
{
(*"c")++;
}
......@@ -1539,7 +1539,13 @@ instrument_object_size (gimple_stmt_iterator *gsi, bool is_lhs)
return;
bool decl_p = DECL_P (inner);
tree base = decl_p ? inner : TREE_OPERAND (inner, 0);
tree base;
if (decl_p)
base = inner;
else if (TREE_CODE (inner) == MEM_REF)
base = TREE_OPERAND (inner, 0);
else
return;
tree ptr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (t)), t);
while (TREE_CODE (base) == SSA_NAME)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment