]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
include/object: pass "snapid_t&" to bound_encode()
authorKefu Chai <kchai@redhat.com>
Wed, 19 Oct 2016 09:01:23 +0000 (17:01 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 19 Oct 2016 09:04:49 +0000 (17:04 +0800)
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 <kchai@redhat.com>
src/include/object.h

index 4532b789c377773bab7786b4c910f0e9849d41b6..303fed3eecfac5aded61034a5aa01204bd04101c 100644 (file)
@@ -127,7 +127,7 @@ struct denc_traits<snapid_t> {
   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) {