Guarantee crash on Result self-move.
GitOrigin-RevId: 64475d63e5ccc3ebac99d21946941b8f5689cfe8
This commit is contained in:
parent
786adb165d
commit
8687be3f12
@ -343,6 +343,7 @@ class Result {
|
|||||||
other.status_ = Status::Error<-2>();
|
other.status_ = Status::Error<-2>();
|
||||||
}
|
}
|
||||||
Result &operator=(Result &&other) {
|
Result &operator=(Result &&other) {
|
||||||
|
CHECK(this != &other);
|
||||||
if (status_.is_ok()) {
|
if (status_.is_ok()) {
|
||||||
value_.~T();
|
value_.~T();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user