UTBotCpp icon indicating copy to clipboard operation
UTBotCpp copied to clipboard

To catch C/C++ signed/unsigned overflow

Open danfudan opened this issue 3 years ago • 1 comments

Great Improvement has been made for UTBot 167, more robust and stable. but I am expecting UTBOT to catch C/C++ signed/unsigned overflow directly.

int absolute(int a)
{
	if (a < 0){
		return -a;
	}
	else {
		return a;
	}
}

typedef unsigned int     uint32_t;
uint32_t change_val()
{
    uint32_t val=255*1024*1024;
    uint32_t new_val;
    new_val = (((uint32_t)(val))*1024*1024); 
	return new_val;
}

There are overflow in above 2 functions, but UTbot didn't report issue. Can UTBot report issue (or at least warn users) if there is overflow issues?

danfudan avatar May 23 '22 07:05 danfudan

@sava-cska, please investigate test generation then the option is on.

ladisgin avatar Sep 07 '22 08:09 ladisgin