fixes for ASAn
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <AzCore/std/createdestroy.h>
|
||||
#include <AzCore/std/iterator.h>
|
||||
|
||||
@@ -46,6 +45,10 @@ namespace AZStd
|
||||
return npos;
|
||||
}
|
||||
size_t foundIndex = searchIndex + charFindIndex;
|
||||
if (foundIndex + count > size)
|
||||
{
|
||||
return npos; // the rest of the string doesnt fit in the remainder of the data buffer
|
||||
}
|
||||
if (Traits::compare(&data[foundIndex], ptr, count) == 0)
|
||||
{
|
||||
return foundIndex;
|
||||
|
||||
@@ -1458,17 +1458,17 @@ namespace UnitTest
|
||||
constexpr double v15 = 0;
|
||||
constexpr const char* v16 = "Hello";
|
||||
constexpr const wchar_t* v17 = L"Hello";
|
||||
constexpr void* v18 = 0;
|
||||
constexpr void* v18 = nullptr;
|
||||
|
||||
// This shouldn't give a compile error
|
||||
AZStd::string::format(
|
||||
"%i %c %uc %c %c %i %i %u %i %lu %li %llu %lli %f %f %s %ls %p",
|
||||
"%i %c %uc %hc %lc %i %i %u %i %lu %li %llu %lli %f %f %hs %ls %p",
|
||||
v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18);
|
||||
|
||||
// This shouldn't give a compile error
|
||||
AZStd::wstring::format(
|
||||
L"%i %c %uc %c %lc %i %i %u %i %lu %li %llu %lli %f %f %s %ls %p",
|
||||
v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18);
|
||||
L"%i %c %uc %hc %lc %i %i %u %i %lu %li %llu %lli %f %f %hs %ls %p",
|
||||
v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18);
|
||||
|
||||
class WrappedInt
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user