From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:28430 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237020AbhGMPii (ORCPT ); Tue, 13 Jul 2021 11:38:38 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16DFWQRU032594 for ; Tue, 13 Jul 2021 15:35:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2020-01-29; bh=TDWT3WALCbKs7aUVG4XhhXrRFJaAawkGJ0+vYz8xIrM=; b=YUhjtpiZ09vx+9uGY06mpOMV44atnfsVgaR6fED84RGfgWgYvKzPuEDnMDNQy3FtAR6q ahXCzlwOTGI0im4NQKywMswFbZ9nNn8WMS3lHG90Yk8MNf0GXoaPC75Fgs8o5FL4GkzB Tk31Fg70r5vfnHP/9wZNF/grYORIYuyJCYf5A0oOb+Byiu2bxsziNSWEln22PSlXybw/ RsOArcmUhaXFbwjaKHT29aT71ZOjuHXWWyd61LIgM/71F2sYk726RArnE+W4tha2fmpR Y6jQKX9rZECHOnaQSKf5yoBu0fl2Sw2hToddTIOuTlRxaKfVWtl3A1WQtrZCJz11fONI dA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 39rpd8tvrm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 13 Jul 2021 15:35:48 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16DFUtZ6189387 for ; Tue, 13 Jul 2021 15:35:47 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by aserp3030.oracle.com with ESMTP id 39qycw08es-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 13 Jul 2021 15:35:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TDWT3WALCbKs7aUVG4XhhXrRFJaAawkGJ0+vYz8xIrM=; b=CYK4DllYE+B2O/1H9giriun+u7RlYJYsVfmm7MCuIundBTtRg5zHmo0n+K4Mn1WAqFr8dcEL9rHHgDD+uUIhjLR04amjlROQ2u9mekPPic6W1BWhRcnfMReaxX8vFOO2feJygNxLY0TMaiGWXbTLz7AjQ+C/BcasBBFSRi4WErk= Date: Tue, 13 Jul 2021 18:35:28 +0300 From: Dan Carpenter Subject: Re: [PATCH 2/2] extra: Fix handle_bit_test so that null set condition is taken care of Message-ID: <20210713153527.GS1954@kadam> References: <20210713125006.12329-1-harshvardhan.jha@oracle.com> <20210713125006.12329-2-harshvardhan.jha@oracle.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210713125006.12329-2-harshvardhan.jha@oracle.com> MIME-Version: 1.0 List-ID: To: Harshvardhan Jha Cc: smatch@vger.kernel.org I have applied the first commit but this one still needs work. Consider this test case: #include "check_debug.h" unsigned int frob(); void test(void) { unsigned int mask = 0xff0; unsigned int x = frob(); if (frob()) mask |= 0x2; if (x < 0 || x > 11) return; if ((1 << x) & mask) { __smatch_implied(x); return; } __smatch_implied(x); } The output is: test.c:17 test() implied: x = '1-11' test.c:20 test() implied: x = '0' The first implied is correct but the second is wrong. BIT(1) or 0x2 is *possibly* set or *possibly not* set. So on the false path the range list should be 0-1. regards, dan carpenter