Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUcV5-0003Lx-VX for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Nov 2019 20:10:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iUcV4-0000Mf-IS for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Nov 2019 20:10:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUcV4-0000MY-BE for pgsql-bugs@lists.postgresql.org; Tue, 12 Nov 2019 20:10:54 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iUcV1-0005Ue-H9 for pgsql-bugs@lists.postgresql.org; Tue, 12 Nov 2019 20:10:53 +0000 Received: by mail-qt1-x843.google.com with SMTP id g50so21188200qtb.4 for ; Tue, 12 Nov 2019 12:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=TgWypiVlVSVg/CEMP+Cd8J6zX7kRUOM6xjhHeJeAmRE=; b=A9Bb7fh31BfdNjEyeMkkfOy6IOslug5jg/R7nuJvqEwoHXVTEESGhSl5mZS6qDFL1a rhrdhdK2H2QN+6Sej2ABPxmOgiK5wkGQtaemGw3gj6LjBqbxsKQfJqBMhyTjPWE+qRzj ibKibcCPtInEHW4squNxoXKZtHKbA+AI5yunJclwNRpUC9Uk6QtQdd3KJs3vVEImrIqO q53Dh/1vVfSpW/j5LO6gz+6JkOzXs5Rsk3pDbamkh6OtKggzqiatghrhXRxHnVxEx18P AD+eE4w++5oV9LK7LtmeRhgLwATxFtEApU28MoZtRlztCPF7Yjbui/GIuJXt7n5O17eR MjEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=TgWypiVlVSVg/CEMP+Cd8J6zX7kRUOM6xjhHeJeAmRE=; b=Hyp9wOvu1PuC8hOppP5JBvgBOGqXR6AL4gVGppBBXwsZWj5IXNt10ulJvNtoye7aJJ Nd4bAmI5Z0TWkntfr/LbUttP2Vyp+PMNiomBTnlgNUk9ovUFBDtELqN19gZ8xtCSOLDy V13F+qYb+6xXiSR208BQVPjRXqGIJQc0Xs7xQm6c3EobndWPs3xLOxTtxyyU4ZIXEt1d 0sX8Cfx6kyV3da2d9RqWbTDz2JiEjjVTDJJoak2wJOQS9KIaJZKV1TOrWE2cxbRpUkuT bl4YWBsdc9fp6lWPLb726nGgssQuTQxWZIWtBTxU5fX8T7s4EyVHrQXL60BJrvHQ55R3 agrQ== X-Gm-Message-State: APjAAAXZb3joB2ydE02u5l4xHAiBIybRDxpFi+B/NEr5P2h4egTE9P2l /uwNB3vM3YwIHf1/5uSduY/XuA== X-Google-Smtp-Source: APXvYqxI5dr8dOI4+3vdTsUvN0rG+G657YMNnRf9D9Ht/fZHKZjRhq+3tnAQDYMF3Xr2vKP5hwHYJg== X-Received: by 2002:aed:3fc4:: with SMTP id w4mr34048452qth.120.1573589449716; Tue, 12 Nov 2019 12:10:49 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.95.19.128]) by smtp.gmail.com with ESMTPSA id o28sm11780382qtk.4.2019.11.12.12.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 12:10:49 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id C4098300AA4; Tue, 12 Nov 2019 17:10:46 -0300 (-03) Date: Tue, 12 Nov 2019 17:10:46 -0300 From: Alvaro Herrera To: Tom Lane Cc: Kyotaro Horiguchi , ranier_gyn@hotmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: [BUG FIX] Uninitialized var fargtypes used. Message-ID: <20191112201046.GA29021@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6298.1573574830@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Nov-12, Tom Lane wrote: > If we're going to revert 0a52d378b03b we should just treat the > problem straightforwardly. I was imagining > > - if (memcmp(argtypes, clist->args, nargs * sizeof(Oid)) == 0) > + /* if nargs==0, argtypes can be null; don't pass that to memcmp */ > + if (nargs == 0 || > + memcmp(argtypes, clist->args, nargs * sizeof(Oid)) == 0) > > It's really stretching credulity to imagine that one more test-and-branch > in this loop costs anything worth noticing, especially compared to the > costs of having built the list to begin with. So I'm now feeling that > 0a52d378b03b was penny-wise and pound-foolish. I pushed using that approach. For a minute I thought that it should also test that clist->nargs also equals 0, but that turns out not to be necessary since the number of arguments is already considered by FuncnameGetCandidates above. Thanks -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services