Skip to content

Release builds: turn on overflow checks - #22

Merged
LudaLunizz merged 1 commit into
Silvertree2010:mainfrom
LudaLunizz:release-overflow-checks
Nov 17, 2026
Merged

LudaLunizz merged 1 commit into
Silvertree2010:mainfrom
LudaLunizz:release-overflow-checks

Conversation

@LudaLunizz

Copy link
Copy Markdown
Collaborator

Release builds wrap silently on integer overflow (the rustc default), so an arithmetic bug gives a wrong number instead of a stop. noname does a lot of u16/usize arithmetic and as casts when it lays out the screen (about 18 casts in lib.rs alone).

This adds overflow-checks = true to [profile.release] (profile.dist inherits it). It follows the rustc exploit-mitigations guidance and the ANSSI secure Rust guide.

What it can change: a wrap that was silent before would now panic. Checked: cargo build --release --locked, cargo test --release --locked (19 tests), and a headless pty run of the release build at 10 window sizes (1x1 up to 250x70) opening /noname, scrolling, typing and pressing Ctrl+C twice, with no panic. Binary size and speed: not measured.

If you would rather not risk a panic where it used to wrap, this is easy to drop.

🤖 Generated with Claude Code

Release builds wrap silently on integer overflow (rustc default), so an
arithmetic bug shows up as a wrong number instead of a stop. The screen code
does a lot of u16/usize arithmetic and casts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0c190339-71df-433f-94a0-7a725fd47bb0
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@LudaLunizz
LudaLunizz merged commit e97d10f into Silvertree2010:main Nov 17, 2026
3 checks passed
This was referenced Nov 17, 2026
@LudaLunizz
LudaLunizz deleted the release-overflow-checks branch November 27, 2026 19:24
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