Skip to content

Hughsie/lazy clear#320

Merged
hughsie merged 2 commits into
mainfrom
hughsie/lazy-clear
Jun 29, 2026
Merged

Hughsie/lazy clear#320
hughsie merged 2 commits into
mainfrom
hughsie/lazy-clear

Conversation

@hughsie

@hughsie hughsie commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when working with tokens, ensuring lists stay correctly terminated during updates.
    • Fixed cleanup handling for value bindings so existing entries are cleared consistently, even in edge cases.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 70ed3bd6-1b93-4371-9a6d-5bcdd97c215f

📥 Commits

Reviewing files that changed from the base of the PR and between 9e03f2e and 70b3cca.

📒 Files selected for processing (2)
  • src/xb-opcode.c
  • src/xb-value-bindings.c
💤 Files with no reviewable changes (1)
  • src/xb-value-bindings.c

📝 Walkthrough

Walkthrough

Two small correctness edits: xb_opcode_init now sets only tokens[0] = NULL instead of zeroing the whole buffer, and xb_opcode_append_token writes a NULL terminator after each append. Separately, xb_value_bindings_clear_index has its idx bounds-check guard removed.

Changes

Opcode token array and value bindings fixes

Layer / File(s) Summary
Token array NULL-termination
src/xb-opcode.c
xb_opcode_init sets tokens[0] = NULL to mark the list as empty without zeroing the whole buffer. xb_opcode_append_token now writes tokens[tokens_len] = NULL after each increment to maintain a NULL terminator throughout building.
Bounds-check removal in slot clearing
src/xb-value-bindings.c
xb_value_bindings_clear_index no longer validates idx against G_N_ELEMENTS(_self->values) before accessing the slot, freeing any bound value, and resetting slot fields.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is very vague and reads like a branch name, so it does not clearly describe the actual code changes. Use a descriptive title such as "Lazy-clear opcode tokens and binding values" or similar.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hughsie
hughsie merged commit 1cfb1c3 into main Jun 29, 2026
4 checks passed
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