Skip to content

Commit 887ffd1

Browse files
Fix issue with cformat converting bytes to string for bytesinner (#4760)
1 parent d5975a4 commit 887ffd1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vm/src/cformat.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ pub(crate) fn cformat_bytes(
293293
CFormatPart::Literal(literal) => result.append(literal),
294294
CFormatPart::Spec(spec) => {
295295
let value = match &spec.mapping_key {
296-
Some(key) => values_obj.get_item(key.as_str(), vm)?,
296+
Some(key) => {
297+
let k = vm.ctx.new_bytes(key.as_str().as_bytes().to_vec());
298+
values_obj.get_item(k.as_object(), vm)?
299+
}
297300
None => unreachable!(),
298301
};
299302
let mut part_result = spec_format_bytes(vm, spec, value)?;

0 commit comments

Comments
 (0)