diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2025-03-14 01:29:22 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-13 10:29:22 -0700 |
| commit | 1e20eed6e8749ed09639ef9d788900edbab0ff83 (patch) | |
| tree | f42143d2acc75240e4619abb7d847b4cdf8d0583 | |
| parent | 395302d2404e3429f3cdfa406e89fa76bc0d444b (diff) | |
Correct buffer length calculation in dumpSourceBytes (#6593)
No functional change as overallocating was ok, but this was wrong
Co-authored-by: Yong He <yonghe@outlook.com>
| -rw-r--r-- | source/core/slang-hex-dump-util.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/core/slang-hex-dump-util.cpp b/source/core/slang-hex-dump-util.cpp index b400fb15b..cf11a9a51 100644 --- a/source/core/slang-hex-dump-util.cpp +++ b/source/core/slang-hex-dump-util.cpp @@ -79,7 +79,7 @@ SlangResult HexDumpUtil::dumpSourceBytes( // each byte is output as "0xAA, " // Ends with '\n" - const size_t lineBytes = count * (4 + 1 + 1) * count + 1; + const size_t lineBytes = count * 6 + 1; char* startDst = writer->beginAppendBuffer(lineBytes); char* dst = startDst; |
