Просмотр исходного кода

Merge pull request #289 from lioncash/self-assign

result: Check against self-assignment in ResultVal's copy assignment operator
bunnei 8 лет назад
Родитель
Сommit
4900c51864
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      src/core/hle/result.h

+ 3 - 0
src/core/hle/result.h

@@ -200,6 +200,9 @@ public:
     }
 
     ResultVal& operator=(const ResultVal& o) {
+        if (this == &o) {
+            return *this;
+        }
         if (!empty()) {
             if (!o.empty()) {
                 object = o.object;