From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 9645A1F5AE for ; Thu, 9 Jul 2020 23:02:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726433AbgGIXCw (ORCPT ); Thu, 9 Jul 2020 19:02:52 -0400 Received: from cloud.peff.net ([104.130.231.41]:53736 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbgGIXCw (ORCPT ); Thu, 9 Jul 2020 19:02:52 -0400 Received: (qmail 6364 invoked by uid 109); 9 Jul 2020 23:02:52 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Thu, 09 Jul 2020 23:02:52 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 26603 invoked by uid 111); 9 Jul 2020 23:02:52 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 09 Jul 2020 19:02:52 -0400 Authentication-Results: peff.net; auth=none Date: Thu, 9 Jul 2020 19:02:51 -0400 From: Jeff King To: Chris Torek Cc: "brian m. carlson" , Git List Subject: Re: [PATCH] diff: check for merge bases before assigning sym->base Message-ID: <20200709230251.GC664420@coredump.intra.peff.net> References: <20200707235436.GH9782@camp.crustytoothpaste.net> <20200708043819.GA2303891@coredump.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Jul 08, 2020 at 10:05:44AM -0700, Chris Torek wrote: > > I don't see anything within this function guaranteeing that rpos is set, > > either, though I suspect it is OK due to how the revision parser works. > > Yes, I am depending on the revision parser to balance the left and > right items. I thought about having a BUG check but it seemed > unnecessary. On the other hand, I'm avoiding depending on its > *placement* of left and right items. Being more defensive might > be good here. I could go either way with adding a BUG (and it definitely doesn't need to hold up this fix). I strongly suspect that getting a LEFT without a RIGHT would be a bug in the rev parser, not this code. But seeing a BUG() here might be a more friendly way of being informed of that than a segfault. :) -Peff