Buffer.concat stops copying at an empty Buffer in the interpreter

Open Beginner friendly
#3,887 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
77/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, typescript
Domain
backend

Research direction

Start at the interpreter’s implementation of Buffer.concat and trace how it copies each buffer, especially when an entry has length zero. Run the supplied JavaScript example and compare its output with Node.js: the interpreted result should be 41, matching the IL-verified standalone output.

Written by the indexing model from the issue text.

Description

Found while testing #3884. An empty entry consumes no space and the entries after it still need to be copied.

console.log(Buffer.concat([Buffer.alloc(0), Buffer.of(65)]).toString('hex'));

Node.js v22.23.2 and the IL-verified standalone print 41. SharpTS interpretation prints 00.

Dominant language
C#
Stars
156
Forks
4
Avg merge
13h 20m
Merged PRs (30d)
47

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nickna/SharpTS

All issues in nickna/SharpTS

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.