track bit-level constraints
| Bugzilla Link | 3098 |
| Version | unspecified |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
| CC | @tkremenek,@socketpair,@xuzhongxing |
Extended Description
From SVN revision 59590:
[14] Taking false branch. 221 if (priv->plot_flags & APPLY_SHIFT) 222 { 223 spoints = goo_canvas_points_new (fdata->dparams.nchan); 224 for (i = 0; i < fdata->dparams.nchan; i++) 225 { 226 spoints->coords[2i] = (double)i * fdata->dparams.msi / 1e6; 227 spoints->coords[2i+1] = pshifted[i] * 180 / M_PI; /* rad2deg */ 228 } 229 free (pshifted); 230 }
[15] Taking false branch. 232 if (!shift_only) 233 { 234 mg_2d_plot_add_data_with_tag (MG_2D_PLOT (priv->plot), 235 mg_plot_data_new_from_points (points, data->colour), "phase_response"); 236 }
[16] Taking true branch. 237 if (priv->plot_flags & APPLY_SHIFT) 238 { 239 mg_2d_plot_add_data_with_tag (MG_2D_PLOT (priv->plot),
[17] Pass-by-value argument ('spoints') in function is undefined. 240 mg_plot_data_new_from_points (spoints, "red"), "phase_response_with_shift");
Branches [14] and [16] refer to the same conditional and it can't change between the two, I'm not sure how [17] could ever possibly be true.
mentioned in issue llvm/llvm-bugzilla-archive#7152
mentioned in issue llvm/llvm-bugzilla-archive#6150
mentioned in issue llvm/llvm-bugzilla-archive#4173
*** Bug llvm/llvm-bugzilla-archive#28187 has been marked as a duplicate of this bug. ***
We have some ideas of a bitwise constraint checker in addition to our range constraint checker, but no one's actually sat down and built it. I should add that to the Open Projects page at http://clang-analyzer.llvm.org/open_projects.html.
*** Bug llvm/llvm-bugzilla-archive#10199 has been marked as a duplicate of this bug. ***
*** Bug llvm/llvm-bugzilla-archive#19046 has been marked as a duplicate of this bug. ***
Just hit this today; any plans? Looking at the various reports, even just handling "simple" cases -- where mutation of both operands is impossible between checks -- would be very useful.
Also, looks like Bug 10199 and Bug 17538 are duplicates too.
*** Bug llvm/llvm-bugzilla-archive#6150 has been marked as a duplicate of this bug. ***
*** Bug llvm/llvm-bugzilla-archive#7152 has been marked as a duplicate of this bug. ***
A very small test case:
void testfunc(int myval) { char *myptr = (char *)0; char buf[1024];
if (myval & 0x0f)
myptr = buf;
if (myval & 0x0f)
*myptr = '!';
}
While bit-level constraints would be great, it would reduce false positives just to detect when conditionals are identical.
*** Bug llvm/llvm-bugzilla-archive#4173 has been marked as a duplicate of this bug. ***
This false positive is caused by two things:
(a) We don't track field values yet.
I've added support for initializing global structs to symbolic value.
(b) We need to model the effect of doing a bitmask using '&', which projects out bits of an integer, testing them for 0 or 1. We need to model such bits symbolically.
We need bit-support infrastructure for this.
This false positive is caused by two things:
(a) We don't track field values yet.
(b) We need to model the effect of doing a bitmask using '&', which projects out bits of an integer, testing them for 0 or 1. We need to model such bits symbolically.
assigned to @tkremenek