From: Nathan Sidwell Date: Tue, 28 Jan 2003 17:25:50 +0000 (+0000) Subject: re PR c++/9433 (SegFault in dynamic_cast) X-Git-Tag: releases/gcc-3.2.2~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f31886f24233a6b6ce9d4db6bb315fb0aa4ca1f;p=thirdparty%2Fgcc.git re PR c++/9433 (SegFault in dynamic_cast) libstdc++-v3: PR c++/9433 * libsupc++/tinfo.cc (__vmi_class_type_info::__do_dyncast): Cope with bases which are very ambiguous. gcc/testsuite: PR c++/9433 * g++.dg/abi/dcast1.C: New test. From-SVN: r61986 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e5aa3405bfe8..8890a6d8ef68 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-01-28 Nathan Sidwell + + PR c++/9433 + * g++.dg/abi/dcast1.C: New test. + 2003-01-27 Jeffrey D. Oldham PR c++/47 diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5ca64106f814..025af34b0477 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2003-01-28 Nathan Sidwell + + PR c++/9433 + * libsupc++/tinfo.cc (__vmi_class_type_info::__do_dyncast): Cope + with bases which are very ambiguous. + 2003-01-27 Alexandre Oliva * acinclude.m4 (glibcpp_toolexeclibdir): Instead of diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc index be041048a602..d2e189a1095f 100644 --- a/libstdc++-v3/libsupc++/tinfo.cc +++ b/libstdc++-v3/libsupc++/tinfo.cc @@ -1,5 +1,5 @@ // Methods for type_info for -*- C++ -*- Run Time Type Identification. -// Copyright (C) 1994, 1996, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1994, 1996, 1998, 1999, 2000, 2001, 2002, 2003 // Free Software Foundation // // This file is part of GNU CC. @@ -465,8 +465,9 @@ __do_dyncast (ptrdiff_t src2dst, result.whole2dst = __sub_kind (result.whole2dst | result2.whole2dst); } - else if ((result.dst_ptr != 0 | result_ambig) - && (result2.dst_ptr != 0 | result2_ambig)) + else if ((result.dst_ptr != 0 & result2.dst_ptr != 0) + || (result.dst_ptr != 0 & result2_ambig) + || (result2.dst_ptr != 0 & result_ambig)) { // Found two different DST_TYPE bases, or a valid one and a set of // ambiguous ones, must disambiguate. See whether SRC_PTR is