From patchwork Mon Oct 29 15:39:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 10659445 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62B8F4B7E for ; Mon, 29 Oct 2018 15:39:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FC3129AAE for ; Mon, 29 Oct 2018 15:39:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5418F29AD1; Mon, 29 Oct 2018 15:39:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD43A29AC8 for ; Mon, 29 Oct 2018 15:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727521AbeJ3A3D (ORCPT ); Mon, 29 Oct 2018 20:29:03 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:59238 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727545AbeJ3A3D (ORCPT ); Mon, 29 Oct 2018 20:29:03 -0400 Received: from [148.252.241.226] (helo=rainbowdash) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1gH9dy-0005vR-21; Mon, 29 Oct 2018 15:39:54 +0000 Received: from ben by rainbowdash with local (Exim 4.91) (envelope-from ) id 1gH9dx-0003ee-O9; Mon, 29 Oct 2018 15:39:53 +0000 From: Ben Dooks To: linux-sparse@vger.kernel.org Cc: Ben Dooks Subject: [PATCH 5/5] evaluate: stifle check if one pointer is a noderef Date: Mon, 29 Oct 2018 15:39:52 +0000 Message-Id: <20181029153952.13927-6-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181029153952.13927-1-ben.dooks@codethink.co.uk> References: <20181029153952.13927-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If both t1 and t2 are ptr_ctype_noderef then it should be ok to ignore the address-space of both (in the case of passing to printf style functions). Signed-off-by: Ben Dooks --- evaluate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evaluate.c b/evaluate.c index 2a98a9b..0d5b8ad 100644 --- a/evaluate.c +++ b/evaluate.c @@ -718,7 +718,8 @@ const char *type_difference(struct ctype *c1, struct ctype *c2, /* XXX: we ought to compare sizes */ break; case SYM_PTR: - if (as1 != as2) + if (as1 != as2 && (t1 != &ptr_ctype_noderef && + t2 != &ptr_ctype_noderef)) return "different address spaces"; /* MOD_SPECIFIER is due to idiocy in parse.c */ if ((mod1 ^ mod2) & ~MOD_IGNORE & ~MOD_SPECIFIER)