We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f7a6615 + f0ac7c7 commit ce368e7Copy full SHA for ce368e7
1 file changed
lib/Runtime/Library/JavascriptString.cpp
@@ -2399,7 +2399,7 @@ namespace Js
2399
Assert(count > 0);
2400
2401
const char16* currentRawString = currentString->GetString();
2402
- int currentLength = currentString->GetLength();
+ charcount_t currentLength = currentString->GetLength();
2403
2404
charcount_t finalBufferCount = UInt32Math::Add(UInt32Math::Mul(count, currentLength), 1);
2405
char16* buffer = RecyclerNewArrayLeaf(scriptContext->GetRecycler(), char16, finalBufferCount);
@@ -2413,6 +2413,7 @@ namespace Js
2413
{
2414
char16* bufferDst = buffer;
2415
size_t bufferDstSize = finalBufferCount;
2416
+ AnalysisAssert(bufferDstSize > currentLength);
2417
2418
for (charcount_t i = 0; i < count; i += 1)
2419
0 commit comments