From patchwork Sat Jan 25 05:35:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 11351495 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1637513A4 for ; Sat, 25 Jan 2020 05:35:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E93812071A for ; Sat, 25 Jan 2020 05:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726690AbgAYFfn (ORCPT ); Sat, 25 Jan 2020 00:35:43 -0500 Received: from cloud.peff.net ([104.130.231.41]:44384 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725781AbgAYFfn (ORCPT ); Sat, 25 Jan 2020 00:35:43 -0500 Received: (qmail 10917 invoked by uid 109); 25 Jan 2020 05:35:43 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Sat, 25 Jan 2020 05:35:43 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 13780 invoked by uid 111); 25 Jan 2020 05:42:56 -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; Sat, 25 Jan 2020 00:42:56 -0500 Authentication-Results: peff.net; auth=none Date: Sat, 25 Jan 2020 00:35:42 -0500 From: Jeff King To: git@vger.kernel.org Subject: [PATCH 0/4] more clang/sanitizer fixes Message-ID: <20200125053542.GA744596@coredump.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Here are some more sanitizer fixes, this time from trying with clang-11. These should go on top of jk/asan-build-fix if you want to get a successful run with "make CC=clang-11 SANITIZE=address,undefined test". I don't think any of them is indicative of a current bug in practice, but the UBSan stuff makes me worried that an aggressive compiler might do the wrong thing in some case. [1/4]: merge-recursive: silence -Wxor-used-as-pow warning [2/4]: avoid computing zero offsets from NULL pointer [3/4]: xdiff: avoid computing non-zero offset from NULL pointer [4/4]: obstack: avoid computing offsets from NULL pointer compat/obstack.h | 6 ++++-- merge-recursive.c | 19 ++++++++++++++----- sequencer.c | 6 +++--- unpack-trees.c | 2 +- xdiff-interface.c | 12 ++++++++---- 5 files changed, 30 insertions(+), 15 deletions(-) -Peff