Skip to content

Remove a comment that describes a hazard that does not exist - #97

Merged
SeanTAllen merged 1 commit into
mainfrom
remove-false-gc-comment
Jul 10, 2026
Merged

Remove a comment that describes a hazard that does not exist#97
SeanTAllen merged 1 commit into
mainfrom
remove-false-gc-comment

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

ssl/crypto/hmac_sha256.pony carried a comment claiming Array.init avoids GC buffer corruption that @pony_alloc plus from_cpointer would cause, and citing ponyc#4831. Array[U8].init allocates through the same @pony_alloc, so the garbage collector cannot tell the two apart, and ponyc#4831 was never filed.

ssl/crypto/hash_fn.pony and ssl/crypto/digest.pony use @pony_alloc plus from_cpointer in nine places. A reader who believed the comment read those as latent corruption.

Closes #77

`Array[U8].init` allocates through `Pointer[U8]._alloc`, which calls
`@pony_alloc`. The comment drew a distinction from `@pony_alloc` plus
`from_cpointer` that the garbage collector cannot see, and pointed at a
ponyc issue that was never filed.

`ssl/crypto/hash_fn.pony` and `ssl/crypto/digest.pony` use `@pony_alloc`
plus `from_cpointer` in nine places. A reader who believed the comment
read those as latent corruption.

Closes #77
@SeanTAllen

Copy link
Copy Markdown
Member Author

Autonomous-mode decision log — PR-specific

No PR-specific judgment calls. The issue's fix direction (delete the comment) was
unambiguous, and the review confirmed nothing true was lost — the surviving
comment already explains why arr.cpointer() is handed to HMAC for the empty
message. The nine from_cpointer sites the issue mentions are deliberately left
alone; the issue says converting them is a separate question.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Jul 10, 2026
@SeanTAllen
SeanTAllen merged commit 7c08a82 into main Jul 10, 2026
14 checks passed
@SeanTAllen
SeanTAllen deleted the remove-false-gc-comment branch July 10, 2026 16:49
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hmac_sha256.pony comment claims a GC hazard that does not exist and cites a nonexistent ponyc issue

2 participants