You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ProxyClientBase: avoid static_cast to partially destructed object
This is a bugfix that should fix the UBSan failure reported
#125
In practice there is no real bug here, just like there was no real bug fixed in
the recent "ProxyClientBase: avoid static_cast to partially constructed object"
change in #121. This is
because in practice, ProxyClient subclasses only inherit ProxyClientBase state
and do not define any state of their own, so there is nothing bad that could
actually happen from static_cast-ing a ProxyClientBase pointer to a ProxyClient
pointer inside the ProxyClientBase constructor or destructor.
However, using static_cast this way technically triggers undefined behavior,
and that causes UBSan to fail, so this commit drops the static_cast by making
ProxyClient::construct() and ProxyClient::destroy() methods into static methods
taking a ProxyClientBase& argument instead of instance methods using *this.
Fixes#125
0 commit comments