diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-12-18 11:55:40 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-12-18 11:55:40 +0100 |
| commit | dbee63338fda39170118e3ab1f66637a690f5542 (patch) | |
| tree | 2fd5181d02e683decd48c6ae56a197fb9c4ec5a1 /lib/xixanta/src/object.rs | |
| parent | 864702da68ec69ee92e47e77a65c5a86ba200201 (diff) | |
| download | tools.nes-dbee63338fda39170118e3ab1f66637a690f5542.tar.gz tools.nes-dbee63338fda39170118e3ab1f66637a690f5542.zip | |
Prevent a crash on bad binary literals
When evaluating binary literals we allowed the shift value to grow as
needed and we checked whether it was a good value after evaluating the
literal. This is bad for performance reasons: if we are expecting an
exact size for a literal (8 digits here), do not even attempt to do
anything at all if the size doesn't match.
Moreover, in some extreme cases this could result into an overflow of
the 'shift' variable, which was promptly catched by Rust's bound
checker.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'lib/xixanta/src/object.rs')
0 files changed, 0 insertions, 0 deletions
