summaryrefslogtreecommitdiffstats
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-28 02:19:38 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-28 02:19:38 +0000
commitd2a8db585a283e292222174024e9cedaa881f962 (patch)
tree98c5fb24fb3e291e44cfd8a516911e0197643bf8 /gcc/cp
parentb49614194f76c936209ab34d2b43448e06ef1687 (diff)
downloadppe42-gcc-d2a8db585a283e292222174024e9cedaa881f962.tar.gz
ppe42-gcc-d2a8db585a283e292222174024e9cedaa881f962.zip
PR c++/27177
* class.c (build_base_path): Fix previous change. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131899 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/class.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 714f65b1208..118d25d8f56 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-27 Jason Merrill <jason@redhat.com>
+
+ PR c++/27177
+ * class.c (build_base_path): Fix previous change.
+
2008-01-26 Jakub Jelinek <jakub@redhat.com>
PR c++/34965
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 6b76bf7477f..0ce4ba49990 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -291,8 +291,12 @@ build_base_path (enum tree_code code,
target_type = code == PLUS_EXPR ? BINFO_TYPE (binfo) : BINFO_TYPE (d_binfo);
/* Do we need to look in the vtable for the real offset? */
- /* Don't bother inside sizeof; the source type might not be complete. */
- virtual_access = (v_binfo && fixed_type_p <= 0) && !skip_evaluation;
+ virtual_access = (v_binfo && fixed_type_p <= 0);
+
+ /* Don't bother with the calculations inside sizeof; they'll ICE if the
+ source type is incomplete and the pointer value doesn't matter. */
+ if (skip_evaluation)
+ return build_nop (build_pointer_type (target_type), expr);
/* Do we need to check for a null pointer? */
if (want_pointer && !nonnull)
OpenPOWER on IntegriCloud