Skip to content

Commit b50167a

Browse files
authored
fix: correct bytecode placeholder replacement length
1 parent 6063717 commit b50167a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/common/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ pub fn strip_bytecode_placeholders(bytecode: &BytecodeObject) -> Option<Bytes> {
8282
match &bytecode {
8383
BytecodeObject::Bytecode(bytes) => Some(bytes.clone()),
8484
BytecodeObject::Unlinked(s) => {
85-
// Replace all __$xxx$__ placeholders with 32 zero bytes
86-
let s = (*BYTECODE_PLACEHOLDER_RE).replace_all(s, "00".repeat(40));
85+
// Replace all __$xxx$__ placeholders with 20 zero bytes (40 hex chars)
86+
let s = (*BYTECODE_PLACEHOLDER_RE).replace_all(s, "00".repeat(20));
8787
let bytes = hex::decode(s.as_bytes());
8888
Some(bytes.ok()?.into())
8989
}

0 commit comments

Comments
 (0)