Skip to content

Commit 13ba358

Browse files
bounded int offset refactor (#1606)
1 parent fb74667 commit 13ba358

8 files changed

Lines changed: 355 additions & 458 deletions

File tree

src/executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,13 @@ fn parse_result(
504504
CoreTypeConcrete::BoundedInt(info) => match return_ptr {
505505
Some(return_ptr) => Ok(Value::from_ptr(return_ptr, type_id, registry, true)?),
506506
None => {
507-
let mut data = if info.range.offset_bit_width() <= 64 {
507+
let mut data = if info.range.repr_bit_width() <= 64 {
508508
BigInt::from(ret_registers[0])
509509
} else {
510510
BigInt::from(((ret_registers[1] as u128) << 64) | ret_registers[0] as u128)
511511
};
512512

513-
data &= (BigInt::one() << info.range.offset_bit_width()) - BigInt::one();
513+
data &= (BigInt::one() << info.range.repr_bit_width()) - BigInt::one();
514514
data += &info.range.lower;
515515

516516
Ok(Value::BoundedInt {

0 commit comments

Comments
 (0)