aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 756ceaa..52df2be 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -10947,10 +10947,10 @@ get_binfo_at_offset (tree binfo, HOST_WIDE_INT offset, tree expected_type)
tree fld;
int i;
- gcc_checking_assert (offset >= 0);
if (type == expected_type)
return binfo;
- if (TREE_CODE (type) != RECORD_TYPE)
+ if (TREE_CODE (type) != RECORD_TYPE
+ || offset < 0)
return NULL_TREE;
for (fld = TYPE_FIELDS (type); fld; fld = DECL_CHAIN (fld))