aboutsummaryrefslogtreecommitdiffstats
path: root/ortho/gcc/ortho-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'ortho/gcc/ortho-lang.c')
-rw-r--r--ortho/gcc/ortho-lang.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ortho/gcc/ortho-lang.c b/ortho/gcc/ortho-lang.c
index 5404afbc9..fe02dbcf0 100644
--- a/ortho/gcc/ortho-lang.c
+++ b/ortho/gcc/ortho-lang.c
@@ -1442,13 +1442,15 @@ new_access_element (tree acc)
}
tree
-new_offsetof (tree field, tree rtype)
+new_offsetof (tree rec_type, tree field, tree rtype)
{
tree off;
tree bit_off;
HOST_WIDE_INT pos;
tree res;
+ gcc_assert (DECL_CONTEXT (field) == rec_type);
+
off = DECL_FIELD_OFFSET (field);
/* The offset must be a constant. */