mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
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
|
||
|---|---|---|
| .. | ||
| blobs_queue.cc | ||
| 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 | ||