Skip to content

Commit

Permalink
Fix bug that we might patch incorrect field
Browse files Browse the repository at this point in the history
Reviewed By: pranavtbhat

Differential Revision: D68109683

fbshipit-source-id: 67f97ce24e6b4e23e5c72683a91accf7164db39d
  • Loading branch information
TJ Yin authored and facebook-github-bot committed Jan 13, 2025
1 parent e80a85e commit 7475293
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,10 @@ class BaseEnsurePatch : public BaseClearPatch<Patch, Derived> {
/// object.
template <class Id>
decltype(auto) patch() {
using Ret = op::get_native_type<typename patch_type::underlying_type, Id>;
using FieldPatchType = typename patch_type::underlying_type;
using Ret = op::get_native_type<FieldPatchType, Id>;
return *reinterpret_cast<Ret*>(
typeErasedPatchImpl<op::get_ordinal_v<T, Id>>(
typeErasedPatchImpl<op::get_ordinal_v<FieldPatchType, Id>>(
static_cast<Derived&>(*this)));
}

Expand Down

0 comments on commit 7475293

Please sign in to comment.