angr / claripy

An abstraction layer for constraint solvers.
BSD 2-Clause "Simplified" License
284 stars 93 forks source link

Bit length vs Byte length bug fix in string_length #345

Closed zwimer closed 2 months ago

zwimer commented 1 year ago

Bit length vs Byte length bug fix in string_length

github-actions[bot] commented 1 year ago

Test Results

     96 files  +     86       96 suites  +86   1h 32m 17s :stopwatch: + 1h 31m 43s 1 467 tests +1 161  1 376 :heavy_check_mark: +1 130  90 :zzz: +30  0 :x: ±0  1 :fire: +1  1 473 runs  +1 167  1 382 :heavy_check_mark: +1 136  90 :zzz: +30  0 :x: ±0  1 :fire: +1 

For more details on these errors, see this check.

Results for commit 6b81e46b. ± Comparison against base commit 4b21cf9e.

:recycle: This comment has been updated with latest results.

zwimer commented 1 year ago

@rhelmot In case it is unintended, making an IntToStr with args (<BV32 0xc>,) and kwargs {'length': 80000, 'uninitialized': None} leads to the eager backend logic in __new__ invoking leading to creating a different AST with a different length.

I.e. The output length is 16 bits long instead of 80000 bits.

I updated the PR to keep .length and .bit_length sync'd given this, but it might be worth a look if that isn't expected.