From owner-svn-src-all@FreeBSD.ORG Wed Oct 16 17:00:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 91ACEAA7; Wed, 16 Oct 2013 17:00:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F1272C1B; Wed, 16 Oct 2013 17:00:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9GH0MCS044176; Wed, 16 Oct 2013 17:00:22 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9GH0MnW044173; Wed, 16 Oct 2013 17:00:22 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310161700.r9GH0MnW044173@svn.freebsd.org> From: Dimitry Andric Date: Wed, 16 Oct 2013 17:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256642 - head/contrib/libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2013 17:00:22 -0000 Author: dim Date: Wed Oct 16 17:00:21 2013 New Revision: 256642 URL: http://svnweb.freebsd.org/changeset/base/256642 Log: Since C++ typeinfo objects are currently not guaranteed to be merged at runtime by the dynamic linker, check for their equality in libcxxrt by not only comparing the typeinfo's name pointers, but also comparing the full names, if necessary. (This is similar to what GNU libstdc++ does in its default configuration.) The 'deep' check can be turned off again by defining LIBCXXRT_MERGED_TYPEINFO, and recompiling libcxxrt. Reviewed by: theraven MFC after: 3 days Modified: head/contrib/libcxxrt/typeinfo.cc Modified: head/contrib/libcxxrt/typeinfo.cc ============================================================================== --- head/contrib/libcxxrt/typeinfo.cc Wed Oct 16 16:53:00 2013 (r256641) +++ head/contrib/libcxxrt/typeinfo.cc Wed Oct 16 17:00:21 2013 (r256642) @@ -35,15 +35,23 @@ type_info::~type_info() {} bool type_info::operator==(const type_info &other) const { +#ifdef LIBCXXRT_MERGED_TYPEINFO return __type_name == other.__type_name; +#else + return __type_name == other.__type_name || strcmp(__type_name, other.__type_name) == 0; +#endif } bool type_info::operator!=(const type_info &other) const { - return __type_name != other.__type_name; + return !operator==(other); } bool type_info::before(const type_info &other) const { +#ifdef LIBCXXRT_MERGED_TYPEINFO return __type_name < other.__type_name; +#else + return strcmp(__type_name, other.__type_name) < 0; +#endif } const char* type_info::name() const {