diff --git a/src/backend_x64/reg_alloc.cpp b/src/backend_x64/reg_alloc.cpp index b9e492b2..86c9dbf8 100644 --- a/src/backend_x64/reg_alloc.cpp +++ b/src/backend_x64/reg_alloc.cpp @@ -6,6 +6,7 @@ #include #include +#include #include @@ -487,8 +488,7 @@ void RegAlloc::Move(HostLoc to, HostLoc from) { EmitMove(to, from); - LocInfo(to) = LocInfo(from); - LocInfo(from) = {}; + LocInfo(to) = std::exchange(LocInfo(from), {}); } void RegAlloc::CopyToScratch(HostLoc to, HostLoc from) {