(
instruction_index: usize,
instruction: &Instruction,
mut state: FrameState,
local_hints: &[FrameValue],
constant_pool: &ConstantPool,
context: &str,
)
| 437 | let remaining = locals_loaded_before_definite_store( |
| 438 | instructions, |
| 439 | initial_locals, |
| 440 | max_locals as usize, |
| 441 | context, |
| 442 | exception_table, |
| 443 | )?; |
| 444 | if !remaining.is_empty() { |
| 445 | return Err(jvm::Error::VerificationError { |
| 446 | context: context.to_string(), |
| 447 | message: format!( |
| 448 | "Local initialization could not resolve verifier Top loads: {remaining:?}" |
| 449 | ), |
| 450 | }); |
| 451 | } |
| 452 | |
| 453 | let analysis = solve_frame_states( |
| 454 | instructions, |
| 455 | initial_locals, |
| 456 | local_hints, |
| 457 | max_locals as usize, |
| 458 | constant_pool, |
| 459 | context, |
| 460 | exception_table, |
| 461 | )?; |
| 462 | |
| 463 | Ok((usize::from(prefix_len), analysis)) |
| 464 | } |
| 465 | |
| 466 | fn shift_exception_table( |
| 467 | exception_table: &mut [ExceptionTableEntry], |
| 468 | amount: u16, |
| 469 | context: &str, |
| 470 | ) -> jvm::Result<()> { |
| 471 | for entry in exception_table { |
| 472 | entry.range_pc.start = entry.range_pc.start.checked_add(amount).ok_or_else(|| { |
| 473 | jvm::Error::VerificationError { |
| 474 | context: context.to_string(), |
| 475 | message: "exception range start overflowed while inserting a prefix".to_string(), |
| 476 | } |
| 477 | })?; |
| 478 | entry.range_pc.end = entry.range_pc.end.checked_add(amount).ok_or_else(|| { |
| 479 | jvm::Error::VerificationError { |
| 480 | context: context.to_string(), |
| 481 | message: "exception range end overflowed while inserting a prefix".to_string(), |
| 482 | } |
| 483 | })?; |
| 484 | entry.handler_pc = |
| 485 | entry |
| 486 | .handler_pc |
| 487 | .checked_add(amount) |
| 488 | .ok_or_else(|| jvm::Error::VerificationError { |
| 489 | context: context.to_string(), |
| 490 | message: "exception handler overflowed while inserting a prefix".to_string(), |
| 491 | })?; |
| 492 | } |
| 493 | Ok(()) |
| 494 | } |
| 495 | |
| 496 | fn loaded_local(instruction: &Instruction) -> Option<(u16, FrameValue)> { |
no test coverage detected