Gabor Marton
792be5df92
[analyzer][solver] Fix CmpOpTable handling bug
...
There is an error in the implementation of the logic of reaching the `Unknonw` tristate in CmpOpTable.
```
void cmp_op_table_unknownX2(int x, int y, int z) {
if (x >= y) {
// x >= y [1, 1]
if (x + z < y)
return;
// x + z < y [0, 0]
if (z != 0)
return;
// x < y [0, 0]
clang_analyzer_eval(x > y); // expected-warning{{TRUE}} expected-warning{{FALSE}}
}
}
```
We miss the `FALSE` warning because the false branch is infeasible.
We have to exploit simplification to discover the bug. If we had `x < y`
as the second condition then the analyzer would return the parent state
on the false path and the new constraint would not be part of the State.
But adding `z` to the condition makes both paths feasible.
The root cause of the bug is that we reach the `Unknown` tristate
twice, but in both occasions we reach the same `Op` that is `>=` in the
test case. So, we reached `>=` twice, but we never reached `!=`, thus
querying the `Unknonw2x` column with `getCmpOpStateForUnknownX2` is
wrong.
The solution is to ensure that we reached both **different** `Op`s once.
Differential Revision: https://reviews.llvm.org/D110910
2021-10-06 18:28:03 +02:00
..
2021-10-04 17:08:34 +02:00
2020-09-22 11:05:04 -07:00
2021-02-17 09:02:49 +01:00
2021-08-10 19:11:21 +03:00
2021-01-25 15:53:00 -08:00
2021-08-02 19:15:01 +03:00
2021-07-09 11:44:34 -04:00
2021-07-18 19:54:28 +05:30
2021-08-26 13:34:29 -07:00
2021-05-04 16:50:21 +02:00
2021-09-13 15:01:20 +02:00
2021-07-13 04:52:47 +00:00
2020-09-15 16:35:39 +02:00
2021-03-30 16:04:19 +03:00
2021-01-31 19:56:26 -05:00
2021-09-14 11:29:47 +02:00
2021-07-01 10:54:22 +02:00
2020-08-27 12:15:25 -07:00
2020-08-27 12:15:25 -07:00
2020-08-27 12:15:23 -07:00
2021-07-01 10:54:28 +02:00
2021-01-25 15:53:00 -08:00
2021-01-25 15:53:00 -08:00
2021-01-25 15:53:00 -08:00
2021-02-22 14:16:43 -08:00
2020-07-06 16:18:15 +01:00
2021-07-09 11:44:34 -04:00
2021-07-06 11:09:08 +03:00
2021-10-06 18:28:03 +02:00
2021-09-16 11:42:54 +02:00
2021-09-16 11:42:54 +02:00
2021-08-27 11:31:16 +02:00
2021-07-12 09:06:46 +02:00
2020-06-11 10:56:59 +02:00
2020-07-28 11:52:29 -05:00
2020-07-09 15:36:33 +02:00
2021-03-10 13:07:49 +01:00
2021-03-04 15:10:04 +01:00
2020-06-11 10:56:59 +02:00
2020-07-13 14:29:47 +02:00
2020-07-13 14:29:47 +02:00
2020-06-11 10:56:59 +02:00
2021-07-09 11:44:34 -04:00
2021-08-27 11:31:16 +02:00
2020-06-25 09:47:13 -07:00
2021-09-28 10:00:15 -07:00
2021-03-30 14:48:38 +02:00
2021-03-30 14:48:38 +02:00
2021-07-13 21:00:30 +03:00
2021-05-12 19:00:08 +00:00
2020-06-09 12:08:56 +02:00
2021-04-05 19:04:53 +02:00
2020-06-09 12:08:56 +02:00
2021-07-14 13:45:02 +02:00
2021-07-14 13:45:02 +02:00
2021-07-14 13:45:02 +02:00
2021-04-05 19:17:52 +02:00
2021-06-14 12:19:09 +02:00
2021-09-04 10:19:57 +02:00
2021-03-04 17:00:54 +00:00
2021-03-04 17:00:54 +00:00
2021-01-06 16:23:49 -08:00
2021-09-24 12:37:58 +03:00
2021-09-24 12:37:58 +03:00
2021-04-08 20:30:12 +03:00
2020-08-11 10:10:13 +02:00
2020-07-01 09:04:28 +02:00
2020-08-04 11:04:12 +02:00
2021-03-10 12:42:24 +01:00
2021-02-02 11:22:46 -08:00
2020-09-15 17:43:02 +02:00
2020-09-15 17:43:02 +02:00
2021-08-27 11:31:16 +02:00
2021-07-12 17:06:07 +03:00
2021-02-25 19:25:00 +00:00
2021-08-27 14:41:26 +02:00
2021-05-30 09:51:41 +08:00
2021-04-07 13:43:19 +02:00
2021-05-19 12:40:09 +02:00
2021-04-05 19:17:52 +02:00
2021-08-11 13:04:55 +02:00
2020-07-01 09:04:28 +02:00
2021-09-03 16:01:09 -04:00
2021-05-17 20:10:26 +02:00
2020-07-22 13:02:39 +03:00
2020-06-25 09:47:13 -07:00
2021-07-09 11:44:34 -04:00
2021-01-15 21:38:47 +00:00
2021-05-24 10:16:52 +02:00
2021-05-24 10:16:52 +02:00
2021-09-13 15:01:20 +02:00
2021-03-30 14:48:38 +02:00
2021-07-09 11:44:34 -04:00
2021-07-09 11:44:34 -04:00
2020-09-11 15:58:48 +02:00
2021-05-27 13:12:19 -07:00
2021-05-27 13:12:19 -07:00
2021-03-30 15:58:06 +03:00
2021-03-10 12:42:23 +01:00
2021-02-22 14:16:43 -08:00
2021-07-04 06:57:11 +03:00
2020-06-16 16:10:07 +03:00
2021-09-21 11:21:40 -07:00
2021-02-22 11:12:22 +01:00
2021-02-22 11:12:18 +01:00
2021-02-22 11:12:18 +01:00
2021-02-15 11:44:37 +03:00
2020-07-15 12:19:25 +02:00
2021-08-10 19:11:21 +03:00
2021-08-10 19:19:27 +03:00
2021-03-12 15:56:48 +03:00
2021-03-22 11:02:02 +03:00
2021-05-13 20:16:29 +03:00
2021-04-07 13:44:43 +03:00
2021-04-01 11:59:00 +02:00
2021-04-01 11:59:00 +02:00
2021-04-06 11:15:29 +02:00
2021-10-06 05:18:27 -05:00
2021-02-15 16:38:15 +03:00
2020-07-30 09:52:28 +02:00
2021-04-28 18:37:38 +03:00
2021-04-28 18:37:37 +03:00
2021-08-11 13:04:55 +02:00
2021-07-28 20:52:57 +00:00
2021-08-13 16:14:54 +02:00
2021-06-17 10:27:34 +02:00
2021-07-18 19:54:28 +05:30
2021-07-21 18:23:35 +05:30
2021-08-10 16:12:52 -05:00
2021-07-23 14:25:32 +02:00
2021-06-25 11:49:26 +02:00
2021-07-16 03:22:57 -05:00
2021-06-25 11:49:26 +02:00
2021-08-27 11:31:16 +02:00
2021-04-23 17:27:54 +02:00
2021-04-27 15:35:58 +02:00
2021-04-27 15:35:58 +02:00
2021-04-23 17:27:54 +02:00
2020-09-10 12:29:39 +02:00
2020-09-07 17:56:26 +02:00
2020-09-07 17:56:26 +02:00
2020-09-01 11:36:20 +02:00
2020-07-20 22:46:24 +02:00
2020-09-10 12:29:39 +02:00
2020-09-04 11:48:38 +02:00
2020-09-04 11:48:38 +02:00
2020-09-15 16:35:39 +02:00
2020-09-23 10:48:14 +02:00
2020-11-30 18:06:28 +01:00
2021-07-21 08:54:11 +02:00
2020-07-23 11:53:25 +02:00
2020-06-22 11:15:35 +02:00
2021-04-29 01:03:38 +03:00
2021-07-09 11:44:34 -04:00
2020-06-09 12:08:57 +02:00
2021-06-25 23:09:16 +03:00
2021-04-28 18:37:38 +03:00
2021-04-28 18:37:38 +03:00
2020-08-07 10:39:28 -07:00
2021-07-09 11:44:34 -04:00
2020-07-06 15:34:51 +02:00
2021-02-25 19:25:00 +00:00
2021-03-25 18:25:06 +01:00