ソースを参照

Fixed too restrictive assertion in safeMemoryCopy.

David Piuva 4 年 前
コミット
ff1a8684d7
1 ファイル変更1 行追加1 行削除
  1. 1 1
      Source/DFPSR/base/SafePointer.h

+ 1 - 1
Source/DFPSR/base/SafePointer.h

@@ -223,7 +223,7 @@ inline void safeMemoryCopy(SafePointer<T> target, const SafePointer<S>& source,
 		source.assertInside("memoryCopy (source)", source.getUnsafe(), (size_t)byteSize);
 		// memcpy doesn't allow pointer aliasing
 		// TODO: Make a general assertion with the same style as out of bound exceptions
-		assert(((const uint8_t*)target.getUnsafe()) + byteSize < (uint8_t*)source.getUnsafe() || ((const uint8_t*)source.getUnsafe()) + byteSize < (uint8_t*)target.getUnsafe());
+		assert(((const uint8_t*)target.getUnsafe()) + byteSize <= (uint8_t*)source.getUnsafe() || ((const uint8_t*)source.getUnsafe()) + byteSize <= (uint8_t*)target.getUnsafe());
 	#endif
 	std::memcpy(target.getUnsafe(), source.getUnsafe(), (size_t)byteSize);
 }