Skip to content

Fix out-of-bounds UB in getNumber: log full number string instead of number[1]#133

Merged
rrivera747 merged 2 commits intorrivera/add-orsingleshotmode-bitsfrom
copilot/sub-pr-132
Mar 23, 2026
Merged

Fix out-of-bounds UB in getNumber: log full number string instead of number[1]#133
rrivera747 merged 2 commits intorrivera/add-orsingleshotmode-bitsfrom
copilot/sub-pr-132

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

getNumber in CFO_Compiler.cpp logged number[1] via __COUTVS__ before any bounds check, causing out-of-bounds access and undefined behavior for single-character tokens (e.g. "5").

Change

  • Replace __COUTVS__(2, number[1]) with __COUTVS__(2, number) in both integer and fallback branches of getNumber
// Before — UB when number.size() == 1
__COUTVS__(2, number[1]);

// After — safe, logs the full token
__COUTVS__(2, number);

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] [WIP] Address feedback on 'Rrivera/add orsingleshotmode bits' PR Fix out-of-bounds UB in getNumber: log full number string instead of number[1] Mar 23, 2026
Copilot AI requested a review from rrivera747 March 23, 2026 19:48
@rrivera747 rrivera747 marked this pull request as ready for review March 23, 2026 19:52
@rrivera747 rrivera747 merged commit 6a59134 into rrivera/add-orsingleshotmode-bits Mar 23, 2026
@rrivera747 rrivera747 deleted the copilot/sub-pr-132 branch March 23, 2026 19:52
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.

3 participants