Skip to content

misc#329

Open
Smattr wants to merge 8 commits into
mainfrom
smattr/cb5592e6-b196-4921-9e72-09b40824c3b6
Open

misc#329
Smattr wants to merge 8 commits into
mainfrom
smattr/cb5592e6-b196-4921-9e72-09b40824c3b6

Conversation

@Smattr

@Smattr Smattr commented Jun 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

Smattr added 8 commits May 23, 2026 12:15
OpenCode claims the calculation of `ic` can underflow, leading to
generation of an infinite loop. This is a false positive, so lets try to
make that more obvious to static analysis tools.

Reported-by: OpenCode 1.16.2
OpenCode notices that the argument to CLZ could evaluate to 0, leading
to UB. The follow on problem here is that even if it were not, this
still leads to an invalid large `INITIAL_SET_SIZE_EXPONENT`. The effect
of this would be for `--set-capacity x` where `x` is a small number to
generate code that would malfunction at runtime.

Reported-by: OpenCode 1.16.2
Reported-by: OpenCode 1.16.2
OpenCode complains that the shift in this function could be
out-of-range. This is a false positive, seemingly influenced by other
incorrect inferences OpenCode makes about this file. But lets try to
guide static analysis tools like this to something more accurate.

Reported-by: OpenCode 1.16.2
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.

1 participant