Returns the number of bits we need from `load` to compute `var`.
(&self, value: const_eval::Value, load: OutputExprId)
| 341 | |
| 342 | /// Returns the number of bits we need from `load` to compute `var`. |
| 343 | fn get_used_bits(&self, value: const_eval::Value, load: OutputExprId) -> (u8, u8) { |
| 344 | let mut min_bit = u128::BITS as u8; |
| 345 | let mut max_bit = 0; |
| 346 | for bit in value.slice() { |
| 347 | let Bit::Expr(expr) = bit |
| 348 | else { |
| 349 | continue; |
| 350 | }; |
| 351 | if self.loads.contains_key(&expr.id) { |
| 352 | max_bit = max_bit.max(expr.offset); |
| 353 | min_bit = min_bit.min(expr.offset); |
| 354 | } |
| 355 | else if let Some(indirect_use) = self.uses.get(&expr.id).and_then(|x| x.get(&load)) { |
| 356 | max_bit = max_bit.max(indirect_use.max_bit); |
| 357 | min_bit = min_bit.min(indirect_use.min_bit); |
| 358 | } |
| 359 | } |
| 360 | (min_bit, max_bit) |
| 361 | } |
| 362 | |
| 363 | fn find_loads_and_uses(&mut self, block: &lifter::Block, track_loads: bool) { |
| 364 | for (i, stmt) in block.pcode.instructions.iter().enumerate() { |
no test coverage detected