From dbebe41ba53e7390191d24222877a04d705b16f9 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 19 Oct 2016 17:01:23 +0800 Subject: [PATCH] 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 --- src/include/object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/object.h b/src/include/object.h index 4532b789c3777..303fed3eecfac 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) {