(
&mut self,
index: u16,
local_hints: &[FrameValue],
load_hint: FrameValue,
context: &str,
instruction_index: usize,
)
| 98 | context: &str, |
| 99 | instruction_index: usize, |
| 100 | ) -> jvm::Result<FrameValue> { |
| 101 | let value = self.pop_category1(context, instruction_index)?; |
| 102 | if !value.is_reference_like() && value != FrameValue::Top { |
| 103 | return Err(jvm::Error::VerificationError { |
| 104 | context: context.to_string(), |
| 105 | message: format!( |
| 106 | "Expected reference value at instruction {instruction_index}, found {value:?}" |
| 107 | ), |
| 108 | }); |
| 109 | } |
| 110 | Ok(value) |
| 111 | } |
| 112 | |
| 113 | fn load_local( |
| 114 | &mut self, |
| 115 | index: u16, |
| 116 | local_hints: &[FrameValue], |
| 117 | load_hint: FrameValue, |
| 118 | context: &str, |
| 119 | instruction_index: usize, |
| 120 | ) -> jvm::Result<()> { |
| 121 | let mut value = self |
| 122 | .locals |
| 123 | .get(index as usize) |
| 124 | .cloned() |
| 125 | .unwrap_or(FrameValue::Top); |
| 126 | if value == FrameValue::Top { |
| 127 | value = local_hints |
| 128 | .get(index as usize) |
| 129 | .cloned() |
| 130 | .unwrap_or(FrameValue::Top); |
| 131 | if value == FrameValue::Top { |
| 132 | value = load_hint; |
| 133 | if value == FrameValue::Top { |
| 134 | return Err(jvm::Error::VerificationError { |
| 135 | context: context.to_string(), |
| 136 | message: format!( |
no test coverage detected