fix: add self-assign check in operator=

Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-10-02 13:31:29 +00:00
committed by Compute-Runtime-Automation
parent 16d94a0b8c
commit 9337911742
6 changed files with 26 additions and 2 deletions

View File

@@ -518,6 +518,9 @@ struct RequestProperty {
}
}
RequestProperty &operator=(const RequestProperty &other) {
if (this == &other) {
return *this;
}
requestId = other.requestId;
commandId = other.commandId;
componentId = other.componentId;
@@ -561,6 +564,9 @@ struct ResponseProperty {
}
}
ResponseProperty &operator=(const ResponseProperty &other) {
if (this == &other) {
return *this;
}
this->requestId = other.requestId;
this->returnCode = other.returnCode;
this->componentId = other.componentId;