pytorch/caffe2/queue
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
..
blobs_queue.cc fix comparison of narrow type with wide type in loop condition (#53951) 2021-03-22 16:40:35 -07:00
blobs_queue.h
blobs_queue_db.cc
blobs_queue_db.h
CMakeLists.txt
queue_ops.cc
queue_ops.h
queue_ops_gpu.cc
rebatching_queue.cc
rebatching_queue.h
rebatching_queue_ops.cc
rebatching_queue_ops.h