mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
6f14b7f6d0
Summary: This was reported by ASAN. The major issue was that `FakeObjectStore` was returning a copy of a `Tree`, so it was not the case that the `TreeEntry*` returned by `getEntryForFile()` was guaranteed to be "owned by" the `Tree* root` that was passed in. To address this, we change `getEntryForFile()` to now return a copy of the `TreeEntry*` that it gets back from `getEntryPtr()`. It really comes down to this line: ``` auto entry = currentDirectory->getEntryPtr(piece.basename()); ``` because we cannot guarantee that `currentDirectory` will live past the end of `getEntryForFile()`, so we cannot guarantee that return return value of `currentDirectory->getEntryPtr()` will, either. Special thanks to meyering and yfeldblum for helping me debug this. Reviewed By: simpkins Differential Revision: D4024627 fbshipit-source-id: 6295e6f2b1d2f544271b2aebad27a4ad3ae04563 |
||
---|---|---|
.. | ||
cli | ||
config | ||
inodes | ||
integration | ||
journal | ||
model | ||
rocksdb | ||
service | ||
store |