From owner-svn-src-stable@FreeBSD.ORG Wed Feb 25 17:27:04 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EB3ECE3; Wed, 25 Feb 2015 17:27:04 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 083EA9AC; Wed, 25 Feb 2015 17:27:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1PHR3g8021357; Wed, 25 Feb 2015 17:27:03 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1PHR3bj021356; Wed, 25 Feb 2015 17:27:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201502251727.t1PHR3bj021356@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 25 Feb 2015 17:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r279289 - in stable: 10/contrib/llvm/tools/clang/lib/AST 9/contrib/llvm/tools/clang/lib/AST X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2015 17:27:04 -0000 Author: dim Date: Wed Feb 25 17:27:02 2015 New Revision: 279289 URL: https://svnweb.freebsd.org/changeset/base/279289 Log: Pull in r199571 from upstream clang trunk (by Ted Kremenek): Harden InitListExpr::isStringLiteralInit() against getInit() returning null. This led to a crash on invalid code (sorry, no good test case). Fixes . This fixes an assertion when compiling certain incorrect code, as reported upstream in http://llvm.org/PR22684 . Direct commit to stable/10 and stable/9, since head has clang 3.5.1, which already includes this change. Reported by: hbowden@securelabsllc.com Modified: stable/10/contrib/llvm/tools/clang/lib/AST/Expr.cpp Changes in other areas also in this revision: Modified: stable/9/contrib/llvm/tools/clang/lib/AST/Expr.cpp Modified: stable/10/contrib/llvm/tools/clang/lib/AST/Expr.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/AST/Expr.cpp Wed Feb 25 17:06:27 2015 (r279288) +++ stable/10/contrib/llvm/tools/clang/lib/AST/Expr.cpp Wed Feb 25 17:27:02 2015 (r279289) @@ -1892,7 +1892,11 @@ bool InitListExpr::isStringLiteralInit() const ArrayType *AT = getType()->getAsArrayTypeUnsafe(); if (!AT || !AT->getElementType()->isIntegerType()) return false; - const Expr *Init = getInit(0)->IgnoreParens(); + // It is possible for getInit() to return null. + const Expr *Init = getInit(0); + if (!Init) + return false; + Init = Init->IgnoreParens(); return isa(Init) || isa(Init); }