From 8687be3f129763172a28ce8c3bf6726f0a0a5ae3 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 4 Feb 2019 07:05:44 +0300 Subject: [PATCH] Guarantee crash on Result self-move. GitOrigin-RevId: 64475d63e5ccc3ebac99d21946941b8f5689cfe8 --- tdutils/td/utils/Status.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tdutils/td/utils/Status.h b/tdutils/td/utils/Status.h index 4540b4138..1bbddc27d 100644 --- a/tdutils/td/utils/Status.h +++ b/tdutils/td/utils/Status.h @@ -343,6 +343,7 @@ class Result { other.status_ = Status::Error<-2>(); } Result &operator=(Result &&other) { + CHECK(this != &other); if (status_.is_ok()) { value_.~T(); }