diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-04-11 14:34:21 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-04-11 15:12:56 -0700 |
| commit | 7a82d478a3c9301eda4453ec222842f750e13630 (patch) | |
| tree | 87675327dc77a289bfd699c5c12f546804fa56d8 /src/rustllvm/ExecutionEngineWrapper.cpp | |
| parent | 8b6091e8f1f5531fe907f84b6a2b27af04a95e8f (diff) | |
| download | rust-7a82d478a3c9301eda4453ec222842f750e13630.tar.gz rust-7a82d478a3c9301eda4453ec222842f750e13630.zip | |
std: Fix iteration over vectors of 0-size values
Previously, all slices derived from a vector whose values were of size 0 had a null pointer as the 'data' pointer on the slice. This caused first pointer to be yielded during iteration to always be the null pointer. Due to the null pointer optimization, this meant that the first return value was None, instead of Some(&T). This commit changes slice construction from a Vec instance to use a base pointer of 1 if the values have zero size. This means that the iterator will never return null, and the iteration will proceed appropriately. Closes #13467
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
