Powered by Linux
Re: [PATCH 2/2] extra: Fix handle_bit_test so that null set condition is taken care of — Semantic Matching Tool

Re: [PATCH 2/2] extra: Fix handle_bit_test so that null set condition is taken care of

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux