Commit 34b9c45
authored
Fix #12861 Hang in valueFlowCondition() with huge array (danmar#7757)
I tested the fix based on 4617bc2.
Use the cppcheck to check the below code which is submitted on the
ticket #12861.
```
#define ROW A, A, A, A, A, A, A, A,
#define ROW8 ROW ROW ROW ROW ROW ROW ROW ROW
#define ROW64 ROW8 ROW8 ROW8 ROW8 ROW8 ROW8 ROW8 ROW8
#define ROW512 ROW64 ROW64 ROW64 ROW64 ROW64 ROW64 ROW64 ROW64
void f() {
static const char A = 'a';
const char a[] = {
ROW512 ROW512 ROW512 ROW512
};
}
```
With the fix, the overall time is 1.52582s.
Without the fix, the time is 25.9674s.
I also tested the testrunner for running the whole of the unit tests.
There is some performance improment with the fix, but not remarkable.1 parent 1964001 commit 34b9c45
3 files changed
+43
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
1557 | 1558 | | |
1558 | 1559 | | |
1559 | 1560 | | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
1560 | 1564 | | |
1561 | 1565 | | |
1562 | 1566 | | |
| |||
1597 | 1601 | | |
1598 | 1602 | | |
1599 | 1603 | | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
1600 | 1607 | | |
1601 | 1608 | | |
1602 | 1609 | | |
1603 | 1610 | | |
1604 | 1611 | | |
1605 | 1612 | | |
1606 | 1613 | | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
1607 | 1617 | | |
1608 | 1618 | | |
1609 | 1619 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1860 | 1860 | | |
1861 | 1861 | | |
1862 | 1862 | | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
1863 | 1873 | | |
1864 | 1874 | | |
1865 | 1875 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
244 | 267 | | |
245 | 268 | | |
246 | 269 | | |
| |||
0 commit comments