Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

result: Check against self-assignment in ResultVal's copy assignment operator

Lioncashe6375771e26e
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index 97fef7a48d..052f499796 100644
--- a/src/core/hle/result.h
+++ b/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;