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
|
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| common_subexpression_elimination.cc | ||
| common_subexpression_elimination.h | ||
| common_subexpression_elimination_test.cc | ||
| conv_to_nnpack_transform.cc | ||
| conv_to_nnpack_transform.h | ||
| conv_to_nnpack_transform_test.cc | ||
| pattern_net_transform.cc | ||
| pattern_net_transform.h | ||
| pattern_net_transform_test.cc | ||
| single_op_transform.cc | ||
| single_op_transform.h | ||