Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avFSh-0003Xn-4o for pgsql-committers@arkaria.postgresql.org; Wed, 27 Apr 2016 02:44:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1avFSg-00075T-Cl for pgsql-committers@arkaria.postgresql.org; Wed, 27 Apr 2016 02:44:22 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1avFSf-00075K-Tc for pgsql-committers@postgresql.org; Wed, 27 Apr 2016 02:44:21 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1avFSc-0007Hq-FO for pgsql-committers@postgresql.org; Wed, 27 Apr 2016 02:44:21 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 96D82208CD for ; Tue, 26 Apr 2016 22:44:16 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 26 Apr 2016 22:44:16 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=9YHIJrBTRK42C8yp+wGvk+1heCw=; b=pHXiW NNMwo5DtG8CrMeKWT/lXE0xxp4xzkkS4p7rtT3M7Z7sTgg6GNPNTbup8ufWLAx6V 9aGIHFHzCMYV/N/lzpseOkyHvsEMwSsgDWuYyhE2YDhzu3TXx57QbrkcFlJin/Ur epqGyGnaMP6AIwtUFd1j74Y6TktjAxrboIZEOw= X-Sasl-enc: EUxWM1SWc2PuPAebZcNWRTPVV9QxvSeFCbQqcdP1fAqT 1461725056 Received: from intern.anarazel.de (unknown [192.77.237.104]) by mail.messagingengine.com (Postfix) with ESMTPA id 34BCAC00013; Tue, 26 Apr 2016 22:44:16 -0400 (EDT) Date: Tue, 26 Apr 2016 19:44:15 -0700 From: Andres Freund To: Noah Misch Cc: Tom Lane , pgsql-committers@postgresql.org Subject: Re: Re: pgsql: Convert contrib/seg's bool-returning SQL functions to V1 call co Message-ID: <20160427024415.6mv2dtyifpkv7g6v@alap3.anarazel.de> References: <20160427023828.GA2150695@tornado.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160427023828.GA2150695@tornado.leadboat.com> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org On 2016-04-26 22:38:28 -0400, Noah Misch wrote: > On Fri, Apr 22, 2016 at 03:54:48PM +0000, Tom Lane wrote: > > Convert contrib/seg's bool-returning SQL functions to V1 call convention. > > > > It appears that we can no longer get away with using V0 call convention > > for bool-returning functions in newer versions of MSVC. The compiler > > seems to generate code that doesn't clear the higher-order bits of the > > result register, causing the bool result Datum to often read as "true" > > when "false" was intended. This is not very surprising, since the > > function thinks it's returning a bool-width result but fmgr_oldstyle > > assumes that V0 functions return "char *"; what's surprising is that > > that hack worked for so long on so many platforms. > > Does this warrant a change to the "Section 2" comment of postgres.h, > explaining that its precautions no longer suffice everywhere? I don't understand why we don't just drop V0. It makes debugging harder, exploitation easier (call arbitrary functions), and really has no features making it desirable. Andres -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers