Skip to content

Commit aa734ce

Browse files
committed
Fix a member variables initialization order issue
Summary: In MacOS, I got issue with `Footer`'s default constructor, which initialized the magic number with some random number instead of 0. With investigation, I found we forgot to make the kInvalidTableMagicNumber to be static. As a result, kInvalidTableMagicNumber was assgined to `table_magic_number_` before it is initialized (which will be populated with random number). Test Plan: passed current unit tests; also passed the unit tests for the incoming diff which used the default footer. Reviewers: yhchiang CC: leveldb Differential Revision: https://reviews.facebook.net/D16077
1 parent 3304266 commit aa734ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

table/format.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Footer {
109109
kEncodedLength = 2 * BlockHandle::kMaxEncodedLength + 8
110110
};
111111

112-
const uint64_t kInvalidTableMagicNumber = 0;
112+
static const uint64_t kInvalidTableMagicNumber = 0;
113113

114114
private:
115115
// Set the table_magic_number only when it was not previously

0 commit comments

Comments
 (0)