pytorch/modules
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
..
detectron Check CUDA kernel launches (/fbcode/caffe2/) (#49145) 2020-12-10 10:43:03 -08:00
module_test Revert D21369541: Make a separate cmake option for caffe2 tests 2020-05-05 06:30:52 -07:00
observers fix comparison of narrow type with wide type in loop condition (#53951) 2021-03-22 16:40:35 -07:00
rocksdb Remove Caffe2_MAIN_LIBS (#38408) 2020-05-15 12:27:15 -07:00
CMakeLists.txt