From patchwork Mon Jul 1 23:27:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Butcher X-Patchwork-Id: 256246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 1D0712C009C for ; Tue, 2 Jul 2013 09:28:25 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=P6sEMF7LMoITnLSb2/iI1AWiswTi+rvw5RUwDrbOBQNoLm5rp2KvU fIAkKEQX5T/hZIyXGR81ZfVCNvj/l1QJGbCZRZAtwFx9P7DJvg/0Q+PPwHsCyL44 DJYjKw/hmSxNg77Syu/dXAfpXH7kh/SSNVEMeqXzgtMgQFh83knkFw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=uDBesd8qeqPH80SQ6i8RwjZt2ZM=; b=o4xT3sd4035WXxhKFZF9 lVQRNCr1g+aTns7H9avSijqqz5Zyue6wgwN5oNblGeN6d1Pjcj1dWACLAm/0Fwf9 aPhMo+55IffICaFfQOkwiq0deELmDFyD6SS3mBO3rFDnx0yantDUlPlz9epC0sXG 78dpfAUJ6Cqcj+kcB6jN2dc= Received: (qmail 20248 invoked by alias); 1 Jul 2013 23:27:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20128 invoked by uid 89); 1 Jul 2013 23:27:37 -0000 X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS autolearn=ham version=3.3.1 Received: from mail-wg0-f48.google.com (HELO mail-wg0-f48.google.com) (74.125.82.48) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 01 Jul 2013 23:27:36 +0000 Received: by mail-wg0-f48.google.com with SMTP id f11so4154861wgh.3 for ; Mon, 01 Jul 2013 16:27:34 -0700 (PDT) X-Received: by 10.194.60.5 with SMTP id d5mr21851764wjr.26.1372721254571; Mon, 01 Jul 2013 16:27:34 -0700 (PDT) Received: from localhost.localdomain (munkyhouse.force9.co.uk. [84.92.244.81]) by mx.google.com with ESMTPSA id ev19sm19484924wid.2.2013.07.01.16.27.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Jul 2013 16:27:33 -0700 (PDT) From: Adam Butcher To: gcc-patches@gcc.gnu.org Cc: Jason Merrill , Adam Butcher Subject: [PATCH 4/4] [lambda] [polymorphic] [HACK] Avoid crash on symbol table writing when generic lambda declared with iostream (or potentially other code) included. Date: Tue, 2 Jul 2013 00:27:01 +0100 Message-Id: <1372721221-6201-5-git-send-email-adam@jessamine.co.uk> In-Reply-To: <1372721221-6201-1-git-send-email-adam@jessamine.co.uk> References: <1372721221-6201-1-git-send-email-adam@jessamine.co.uk> --- gcc/symtab.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gcc/symtab.c b/gcc/symtab.c index 85d47a8..1ada0f7 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -116,6 +116,15 @@ insert_to_assembler_name_hash (symtab_node node, bool with_clones) tree name = DECL_ASSEMBLER_NAME (node->symbol.decl); + + // FIXME: how does this nullptr get here when declaring a C++ + // FIXME: generic lambda and including iostream (or presumably + // FIXME: any other header with whatever property is triggering + // FIXME: this)!? + // + if (name == 0) + return; + aslot = htab_find_slot_with_hash (assembler_name_hash, name, decl_assembler_name_hash (name), INSERT); @@ -156,6 +165,15 @@ unlink_from_assembler_name_hash (symtab_node node, bool with_clones) else { tree name = DECL_ASSEMBLER_NAME (node->symbol.decl); + + // FIXME: how does this nullptr get here when declaring a C++ + // FIXME: generic lambda and including iostream (or presumably + // FIXME: any other header with whatever property is triggering + // FIXME: this)!? + // + if (name == 0) + return; + void **slot; slot = htab_find_slot_with_hash (assembler_name_hash, name, decl_assembler_name_hash (name),