frdong
92770d25cd
fix comparison of narrow type with wide type in loop condition ( #53951 )
...
Summary:
fix Semmle warning: Comparison of narrow type with wide type in loop condition
For example there is below piece of code:
for (int i=0; i<array.size(); ++i) {}
The problem is that array.size() return type is size_t can be larger type than int depending on the implementation so there is chance that i overflows (for very large array that array size is beyond the range of integer) and this loop will never be terminated.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53951
Reviewed By: zou3519
Differential Revision: D27181495
Pulled By: malfet
fbshipit-source-id: 0612c5cedcdc656c193085e7fbb87dd163f20688
2021-03-22 16:40:35 -07:00
..
2019-03-06 10:48:15 -08:00
2021-02-10 21:38:43 -08:00
2020-07-17 17:19:47 -07:00
2019-02-12 21:16:34 -08:00
2019-02-12 21:16:34 -08:00
2019-03-06 10:48:15 -08:00
2018-07-27 10:56:39 -07:00
2021-03-22 16:40:35 -07:00
2021-03-11 13:02:58 -08:00
2021-03-11 13:02:58 -08:00
2018-08-02 11:54:30 -07:00
2020-12-18 10:54:50 -08:00
2021-03-11 13:02:58 -08:00
2019-03-31 17:42:27 -07:00
2020-09-11 16:27:47 -07:00
2018-03-27 13:10:18 -07:00
2020-03-19 00:29:56 -07:00
2020-08-05 11:39:31 -07:00
2021-01-21 19:09:11 -08:00
2018-03-27 13:10:18 -07:00
2021-03-05 17:22:55 -08:00
2018-06-04 09:04:30 -07:00
2021-03-12 11:32:30 -08:00
2019-10-06 09:37:50 -07:00
2020-12-18 10:54:50 -08:00
2019-03-06 10:48:15 -08:00
2021-03-02 20:14:23 -08:00
2020-10-30 10:14:17 -07:00
2019-02-12 21:16:34 -08:00
2018-11-28 15:45:37 -08:00
2020-12-18 10:54:50 -08:00
2019-03-06 10:48:15 -08:00
2020-08-24 18:29:45 -07:00
2020-12-18 10:54:50 -08:00
2020-10-16 16:08:35 -07:00
2018-09-19 16:45:54 -07:00
2018-09-05 16:28:09 -07:00
2019-11-13 16:48:40 -08:00
2019-12-18 13:10:57 -08:00
2020-12-18 10:54:50 -08:00
2020-12-18 10:54:50 -08:00
2019-06-07 13:48:10 -07:00
2020-04-24 23:13:31 -07:00
2020-12-18 10:54:50 -08:00
2018-10-04 02:09:56 -07:00
2018-03-27 13:10:18 -07:00
2018-08-28 11:57:08 -07:00
2020-12-18 10:54:50 -08:00
2018-12-20 17:04:39 -08:00
2019-08-12 16:12:30 -07:00
2018-10-17 12:57:19 -07:00
2019-01-10 09:35:33 -08:00
2019-06-21 23:06:27 -07:00
2020-12-18 10:54:50 -08:00
2018-11-14 18:04:09 -08:00
2018-10-19 20:22:08 -07:00
2018-03-27 13:10:18 -07:00
2021-01-27 15:44:12 -08:00
2020-11-16 19:17:55 -08:00
2020-12-18 10:54:50 -08:00
2018-03-27 13:10:18 -07:00
2020-03-02 15:43:50 -08:00
2020-12-18 10:54:50 -08:00
2020-04-13 11:31:52 -07:00
2020-12-18 10:54:50 -08:00
2020-09-11 12:50:26 -07:00
2020-12-18 10:54:50 -08:00
2019-12-16 13:57:19 -08:00
2018-12-10 19:30:58 -08:00
2019-12-16 13:57:19 -08:00
2018-12-10 19:30:58 -08:00
2020-03-19 00:29:56 -07:00
2018-12-10 19:30:58 -08:00
2018-11-08 11:34:34 -08:00
2020-01-17 16:03:19 -08:00
2020-12-18 10:54:50 -08:00
2018-10-08 12:24:52 -07:00
2019-12-02 20:17:42 -08:00
2018-12-21 11:09:27 -08:00
2018-11-26 19:10:43 -08:00
2020-03-19 00:29:56 -07:00
2020-12-18 10:54:50 -08:00
2018-11-26 19:10:43 -08:00
2020-03-19 00:29:56 -07:00
2018-10-31 15:59:16 -07:00
2021-02-27 19:49:22 -08:00
2021-02-27 19:49:22 -08:00
2020-04-13 11:31:52 -07:00
2020-09-11 12:50:26 -07:00
2020-12-18 10:54:50 -08:00
2018-12-12 12:21:10 -08:00
2018-12-12 12:21:10 -08:00
2019-12-16 13:57:19 -08:00
2018-09-25 17:41:05 -07:00
2018-09-05 16:28:09 -07:00
2020-12-18 10:54:50 -08:00
2018-03-27 13:10:18 -07:00
2021-03-22 16:40:35 -07:00
2020-12-18 10:54:50 -08:00
2020-05-04 11:54:34 -07:00
2020-07-01 11:48:15 -07:00
2020-12-18 10:54:50 -08:00
2020-05-05 19:45:36 -07:00
2020-11-16 12:59:13 -08:00
2020-10-30 10:14:17 -07:00
2018-07-11 18:54:45 -07:00
2021-03-22 16:40:35 -07:00
2020-03-19 00:29:56 -07:00
2018-03-27 13:10:18 -07:00
2018-10-23 16:21:26 -07:00
2018-03-27 13:10:18 -07:00
2021-02-10 18:05:45 -08:00
2020-01-17 16:03:19 -08:00
2021-02-17 19:13:43 -08:00
2020-01-17 16:03:19 -08:00
2018-03-27 13:10:18 -07:00
2018-07-19 16:25:59 -07:00
2021-02-10 21:38:43 -08:00
2020-12-18 10:54:50 -08:00
2019-01-10 16:22:22 -08:00
2019-10-06 09:37:50 -07:00
2018-11-14 18:04:09 -08:00
2018-08-28 11:57:08 -07:00
2020-11-18 17:42:22 -08:00
2021-03-12 16:22:29 -08:00
2020-01-17 12:13:34 -08:00
2020-12-18 10:54:50 -08:00
2021-02-04 14:09:10 -08:00
2018-09-25 17:41:05 -07:00
2020-03-03 10:33:21 -08:00
2018-09-27 03:09:54 -07:00
2020-12-18 10:54:50 -08:00
2020-10-30 10:14:17 -07:00
2020-12-18 10:54:50 -08:00
2018-08-23 13:39:55 -07:00
2021-03-04 22:57:02 -08:00
2021-03-04 22:57:02 -08:00