]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: svc.bucket: assign to optional<> using "=" 32433/head
authorKefu Chai <kchai@redhat.com>
Fri, 27 Dec 2019 03:38:06 +0000 (11:38 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 27 Dec 2019 03:38:08 +0000 (11:38 +0800)
instead of using

*optional_val = value;

we should use:

optional_val = value;

otherwise we will have following runtime assertion failure like

/usr/include/c++/8/optional:945: constexpr _Tp& std::_Optional_base<_Tp, true, true>::_M_get() [with _Tp = RGWBucketInfo*]: Assertion 'this->_M_is_engaged()' failed.

when compiled with the `_GLIBCXX_ASSERTIONS` macro defined. and recent
`redhat-rpm-config` adds `-D_GLIBCXX_ASSERTIONS` to
`__global_compiler_flags`, which is in turn included by `optflags`. and
`optflags` is pratically used everywhere.

Fixes: https://tracker.ceph.com/issues/43414
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/rgw/services/svc_bucket_sobj.cc

index 66088873c07d191284c088f8a75a40250950cfa0..e59ecd60184b91c99b4d3f4b8c3479de0a4e805d 100644 (file)
@@ -507,7 +507,7 @@ int RGWSI_Bucket_SObj::store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
         return r;
       }
     } else {
-      *orig_info = &shared_bucket_info;
+      orig_info = &shared_bucket_info;
     }
   }