From patchwork Wed Jan 13 13:16:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1425793 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=KZPmO7v2; dkim-atps=neutral Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DG7Jk2pl3z9sWF for ; Thu, 14 Jan 2021 00:17:10 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3AAC53870885; Wed, 13 Jan 2021 13:17:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by sourceware.org (Postfix) with ESMTPS id 8E06A387084C for ; Wed, 13 Jan 2021 13:16:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8E06A387084C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qv1-xf2e.google.com with SMTP id a13so727892qvv.0 for ; Wed, 13 Jan 2021 05:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=X9FCBN5AZx4SVzawhI7If4wcBmle67AAMYLN7dACFAA=; b=KZPmO7v2Z88SgRXZtr6JvsmdLsDcYJJx56AY4+KrZc5Bw5UVav2TGibVP8qJ1iDAez DqgLa4fnkonzy4krKwclac2PS0L7pXPxib+qkAuhtStxbpO0UhQUEncoT9RYPIloP7w+ besmiQF0ee886FqlsH5LlrL3e5IoU00FxYPhKsaHf5neNx1FPB9m6TwktZoe50zsp5TB G4T3aZaIVG9ZWlKfTcwDYGU192rPrXAzj1euHn3YcWaiE0FE97CqA/8aVjL8w8gDDs5I 4EYY7omsRJhafxo8LfcSGptWj3bQJpBTQ8tZ/p+PmtL5qagi0s2j59K6L/myYfJatUW8 DDgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=X9FCBN5AZx4SVzawhI7If4wcBmle67AAMYLN7dACFAA=; b=cJ++7DhO3a9WxQzhVc5iYc8n4Li+fY0rnRfpG8gT0bTGCxyXhsLgOOLRF4RQy4mzH3 boOj8ov7VILshwAJBTgYNMtdL3p2HTUoEYdb/w+5i5Hhr4wweWTJFRFeWiIEOaa/OhZt /Vlzxf0mh/q+XRMICnIfNDJxmGCVvC/P8lxYW1ILMjF2bzGnZUltVTkBtqPcIuGRGSpe 2O+a4IzIxC+Z84LiyspWeiHfHDZ6mS8ORJBEbY8y00ol3x2s+NeLDGfCiFJW8XJ9fRoQ wtfHia8nhZ9wiYJZEgdSyeSoJVPXCoadxJI1JXrc2K/SoFUUY49FJBr7TxattEhialPl gwoA== X-Gm-Message-State: AOAM5331pEKOSVSq3qmcRYKY2PdF9Y+yIyWYnS+w0k16mI0peL1i6SN9 LzBHRqj9U5NRB+S8fk4COgA= X-Google-Smtp-Source: ABdhPJxawmPZCDa5u3OzsyFF54QdWwNbdltmM8xcMx280KaUFv1QYJem3o3YGUOfXajzlonI5FqJYw== X-Received: by 2002:a0c:ac44:: with SMTP id m4mr2026061qvb.45.1610543814931; Wed, 13 Jan 2021 05:16:54 -0800 (PST) Received: from ?IPv6:2620:10d:c0a8:1102:81a1:9ca2:8221:5382? ([2620:10d:c091:480::1:388]) by smtp.googlemail.com with ESMTPSA id x20sm1033437qkj.18.2021.01.13.05.16.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jan 2021 05:16:53 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: c++: Fix cp_build_function_call_vec [PR 98626] Message-ID: <12586ae7-0126-bb13-01cd-5d57977e101f@acm.org> Date: Wed, 13 Jan 2021 08:16:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" I misunderstood the cp_build_function_call_vec API, thinking a NULL vector was an acceptable way of passing no arguments. You need to pass a vector of no elements. PR c++/98626 gcc/cp/ * module.cc (module_add_import_initializers): Pass a zero-element argument vector. diff --git c/gcc/cp/module.cc w/gcc/cp/module.cc index d2093916c9e..1fd0bcfe3eb 100644 --- c/gcc/cp/module.cc +++ w/gcc/cp/module.cc @@ -18977,8 +18977,8 @@ module_add_import_initializers () if (modules) { tree fntype = build_function_type (void_type_node, void_list_node); - vec *args = NULL; - + releasing_vec args; // There are no args + for (unsigned ix = modules->length (); --ix;) { module_state *import = (*modules)[ix];