diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-12-14 09:18:06 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-12-14 09:18:06 -0500 |
commit | baf847016ba616370fca906e168d476d3e043bc0 (patch) | |
tree | 9d6d819144349e9f16400c827fde9ad2ef96f00d /src/btree/bt_handle.c | |
parent | 6212aea67e1386822483034fe83c0caa0947ba2c (diff) | |
download | mongo-baf847016ba616370fca906e168d476d3e043bc0.tar.gz |
gcc47 with [-Werror=maybe-uninitialized] reports we can end up with type
uninitialized in __ref_is_leaf() (based on a call to __wt_ref_info()).
It's not really possible because the path where type isn't set is a path
where we panic because the WT_ADDR structure has an impossible type.
We already ignore the __wt_ref_info() error return in one path, and
there are only two paths that care about the returned type; remove the
error check from __wt_ref_info() and set type to 0 in the failing case
(the same value we use when there's no WT_REF addr to check), the code
that calls this function already checks addr on return.
This simplifies __ref_is_leaf() slightly, it now returns a boolean
instead of an error code with a boolean pointer argument.
Diffstat (limited to 'src/btree/bt_handle.c')
-rw-r--r-- | src/btree/bt_handle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/btree/bt_handle.c b/src/btree/bt_handle.c index 9935d92677c..970528b6e72 100644 --- a/src/btree/bt_handle.c +++ b/src/btree/bt_handle.c @@ -601,7 +601,7 @@ __btree_preload(WT_SESSION_IMPL *session) /* Pre-load the second-level internal pages. */ WT_INTL_FOREACH_BEGIN(session, btree->root.page, ref) { - WT_RET(__wt_ref_info(session, ref, &addr, &addr_size, NULL)); + __wt_ref_info(session, ref, &addr, &addr_size, NULL); if (addr != NULL) WT_RET(bm->preload(bm, session, addr, addr_size)); } WT_INTL_FOREACH_END; |