mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
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:
committed by
Compute-Runtime-Automation
parent
16d94a0b8c
commit
9337911742
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 Intel Corporation
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -30,6 +30,9 @@ class ConstStringRef {
|
||||
}
|
||||
|
||||
ConstStringRef &operator=(const ConstStringRef &rhs) {
|
||||
if (this == &rhs) {
|
||||
return *this;
|
||||
}
|
||||
this->ptr = rhs.ptr;
|
||||
this->len = rhs.len;
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user