Skip to content

builtins: set_at reads its buffer argument by reference, not through a stack view (#1859) - #1865

Merged
InauguralPhysicist merged 1 commit into
mainfrom
fix-1859-gcc14-set-at
Oct 20, 2026
Merged

InauguralPhysicist merged 1 commit into
mainfrom
fix-1859-gcc14-set-at

Conversation

@InauguralPhysicist

Copy link
Copy Markdown
Member

Closes #1859

gcc 14 warned -Wreturn-local-addr in builtin_set_at when compiling the amalgamation (CI's extensions / server job; main too).

  • The cause: the buffer argument came through BUILTIN_LIST_VIEW, whose compound-literal view lives on the stack.
  • Why it was a false positive: the buffer branch only uses the value when it is a VAL_BUFFER, a reference element, never the view. gcc could not see that across the inlined slot_view.
  • The fix: list_get_ref returns the element itself, or NULL for a numeric slot, so the branch is equivalent and the construct is gone.
  • The strict-shape contract's pinned source hash for builtin_set_at is updated with it.

Scope: the Codex Cloud task that produced this also fixed the -O0/-O1 warnings. Those are #1775, and contributor PR #1799 already fixes them, so they were left out.

Verification: CI's extensions / server log (gcc 14) must show no -Wreturn-local-addr. That is checked before this enters the queue.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF

…a stack view (#1859)

gcc 14 warned -Wreturn-local-addr in builtin_set_at when it compiled the
amalgamation (CI's extensions/server job; main too). The argument came through
BUILTIN_LIST_VIEW, whose compound-literal view lives on the stack. The buffer
branch only uses the value when it is a VAL_BUFFER, which is a reference
element, never the view, so it was a false positive. gcc could not see that
across the inlined slot_view.

list_get_ref returns the element itself, or NULL for a numeric slot, so the
branch is equivalent and the construct is gone. The strict-shape contract's
pinned source hash for builtin_set_at is updated with it.

Implemented by Codex Cloud task task_e_6ad6e5220010832d8bba847bbbf0f4ee. The
review kept only this change. The task also fixed the -O0/-O1 warnings, which
are #1775 and the subject of contributor PR #1799, so they were left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T05:11:25.884790Z 44f8d63 PR opened
🔒 Security Review ✅ Completed 2026-10-20T05:16:07.962450Z 44f8d63 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codspeed

codspeed Bot commented Oct 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 13 untouched benchmarks


Comparing fix-1859-gcc14-set-at (44f8d63) with main (f2777c8)

Open in CodSpeed

@InauguralPhysicist
InauguralPhysicist added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 3440000 Oct 20, 2026
59 checks passed
@InauguralPhysicist
InauguralPhysicist deleted the fix-1859-gcc14-set-at branch October 20, 2026 06:05
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.

gcc 14 warns -Wreturn-local-addr in builtin_set_at when compiling the amalgamation (main and phase2-numbers)

1 participant