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
|
||
|---|---|---|
| .. | ||
| hip | ||
| math | ||
| threadpool | ||
| bench_utils.cc | ||
| bench_utils.h | ||
| cast.h | ||
| cast_test.cc | ||
| cblas.h | ||
| CMakeLists.txt | ||
| conversions.h | ||
| cpu_neon.h | ||
| cpuid.cc | ||
| cpuid.h | ||
| cpuid_test.cc | ||
| eigen_utils.h | ||
| fatal_signal_asan_no_sig_test.cc | ||
| filler.h | ||
| fixed_divisor.h | ||
| fixed_divisor_test.cc | ||
| GpuBitonicSort.cuh | ||
| GpuDefs.cuh | ||
| GpuScanUtils.cuh | ||
| map_utils.h | ||
| math-detail.h | ||
| math.h | ||
| math_cpu.cc | ||
| math_gpu.cu | ||
| math_gpu_test.cc | ||
| math_test.cc | ||
| murmur_hash3.cc | ||
| murmur_hash3.h | ||
| proto_convert.cc | ||
| proto_convert.h | ||
| proto_utils.cc | ||
| proto_utils.h | ||
| proto_utils_test.cc | ||
| proto_wrap.cc | ||
| proto_wrap.h | ||
| signal_handler.cc | ||
| signal_handler.h | ||
| simple_queue.h | ||
| simple_queue_test.cc | ||
| smart_tensor_printer.cc | ||
| smart_tensor_printer.h | ||
| smart_tensor_printer_test.cc | ||
| string_utils.cc | ||
| string_utils.h | ||
| zmq_helper.h | ||