mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 22:21:32 +08:00
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
This commit is contained in:
parent
3b5b776210
commit
c71a55f88d
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
18
gcc/testsuite/gcc.dg/ubsan/pr63690.c
Normal file
18
gcc/testsuite/gcc.dg/ubsan/pr63690.c
Normal file
@ -0,0 +1,18 @@
|
||||
/* 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user