diff options
-rw-r--r-- | source/blender/blenlib/BLI_string_ref.hh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_string_ref.hh b/source/blender/blenlib/BLI_string_ref.hh index 34baf94c448..dc73208350f 100644 --- a/source/blender/blenlib/BLI_string_ref.hh +++ b/source/blender/blenlib/BLI_string_ref.hh @@ -610,6 +610,10 @@ constexpr bool operator==(StringRef a, StringRef b) if (a.size() != b.size()) { return false; } + if (a.data() == b.data()) { + /* This also avoids passing null to the call below, which would results in an ASAN warning. */ + return true; + } return STREQLEN(a.data(), b.data(), (size_t)a.size()); } |