Fix BlockFetcher ASAN error

Summary:
Some call sites of BlockFetcher create temporary ReadOptions and pass to BlockFetcher. The temporary object will be gone after BlockFetcher construction but BlockFetcher keep its reference, causing stack-use-after-scope. Fixing it.
Closes https://github.com/facebook/rocksdb/pull/3258

Differential Revision: D6547152

Pulled By: yiwu-arbug

fbshipit-source-id: 6b49e9dd46bb72307f5d8f88ea15faacff35b9bc
main
Yi Wu 7 years ago committed by Facebook Github Bot
parent 4bcb7fb148
commit 7393ef779c
  1. 2
      table/block_fetcher.h

@ -45,7 +45,7 @@ class BlockFetcher {
RandomAccessFileReader* file_; RandomAccessFileReader* file_;
FilePrefetchBuffer* prefetch_buffer_; FilePrefetchBuffer* prefetch_buffer_;
const Footer& footer_; const Footer& footer_;
const ReadOptions& read_options_; const ReadOptions read_options_;
const BlockHandle& handle_; const BlockHandle& handle_;
BlockContents* contents_; BlockContents* contents_;
const ImmutableCFOptions& ioptions_; const ImmutableCFOptions& ioptions_;

Loading…
Cancel
Save