From 7393ef779c2d430d93fabb8c82e0c375f24bc46e Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Tue, 12 Dec 2017 12:08:52 -0800 Subject: [PATCH] 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 --- table/block_fetcher.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table/block_fetcher.h b/table/block_fetcher.h index 7076feb8d..76075b572 100644 --- a/table/block_fetcher.h +++ b/table/block_fetcher.h @@ -45,7 +45,7 @@ class BlockFetcher { RandomAccessFileReader* file_; FilePrefetchBuffer* prefetch_buffer_; const Footer& footer_; - const ReadOptions& read_options_; + const ReadOptions read_options_; const BlockHandle& handle_; BlockContents* contents_; const ImmutableCFOptions& ioptions_;