diff options
author | Siddhesh Poyarekar <siddhesh@gotplt.org> | 2022-06-21 12:15:07 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@gotplt.org> | 2022-06-21 12:15:07 +0530 |
commit | 70454c50b4592fe6876ecca13268264e395e058f (patch) | |
tree | 66e0d9570b3740d06281739bd99eeda1b6ea33c5 /gcc/expr.cc | |
parent | d6ba321135463edff57b94fa0efc6bc0dd314267 (diff) | |
download | gcc-70454c50b4592fe6876ecca13268264e395e058f.zip gcc-70454c50b4592fe6876ecca13268264e395e058f.tar.gz gcc-70454c50b4592fe6876ecca13268264e395e058f.tar.bz2 |
tree-object-size: Don't let error_mark_node escape for ADDR_EXPR [PR105736]
The addr_expr computation does not check for error_mark_node before
returning the size expression. This used to work in the constant case
because the conversion to uhwi would end up causing it to return
size_unknown, but that won't work for the dynamic case.
Modify the control flow to explicitly return size_unknown if the offset
computation returns an error_mark_node.
gcc/ChangeLog:
PR tree-optimization/105736
* tree-object-size.cc (addr_object_size): Return size_unknown
when object offset computation returns an error.
gcc/testsuite/ChangeLog:
PR tree-optimization/105736
* gcc.dg/builtin-dynamic-object-size-0.c (TV4): New struct.
(val3): New variable.
(test_pr105736): New test.
(main): Call it.
Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions