From: Kefu Chai Date: Wed, 19 Oct 2016 09:01:23 +0000 (+0800) Subject: include/object: pass "snapid_t&" to bound_encode() X-Git-Tag: v11.1.0~592^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11552%2Fhead;p=ceph.git include/object: pass "snapid_t&" to bound_encode() otherwise the STL container's encoders will segfault when trying to figure out the element size: they use "denc(*(A*)nullptr, elem_size)" to do the calculation. Signed-off-by: Kefu Chai --- diff --git a/src/include/object.h b/src/include/object.h index 4532b789c377..303fed3eecfa 100644 --- a/src/include/object.h +++ b/src/include/object.h @@ -127,7 +127,7 @@ struct denc_traits { enum { supported = 2 }; enum { featured = false }; enum { bounded = true }; - static void bound_encode(const snapid_t o, size_t& p) { + static void bound_encode(const snapid_t& o, size_t& p) { denc(o.val, p); } static void encode(const snapid_t &o, buffer::list::contiguous_appender& p) {