Parses an insertion/replacement expression of the form: " , , " e.g. 0x40000418,0,0a0b0c0d
(insert: &str)
| 137 | /// |
| 138 | /// e.g. 0x40000418,0,0a0b0c0d |
| 139 | fn parse_modification(insert: &str) -> Option<(u64, usize, Vec<u8>)> { |
| 140 | use icicle_fuzzing::parse_u64_with_prefix; |
| 141 | use icicle_vm::cpu::utils::bytes_from_hex; |
| 142 | |
| 143 | let mut parts = insert.split(','); |
| 144 | let stream = parse_u64_with_prefix(parts.next()?)?; |
| 145 | let offset = parse_u64_with_prefix(parts.next()?)?; |
| 146 | let bytes = bytes_from_hex(parts.next()?)?; |
| 147 | |
| 148 | Some((stream, offset as usize, bytes)) |
| 149 | } |