Преглед изворни кода

Merge pull request #289 from lioncash/self-assign

result: Check against self-assignment in ResultVal's copy assignment operator
bunnei пре 8 година
родитељ
комит
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;