Skip to content

Commit 640b420

Browse files
committed
fix: avoid @ptrCast in StructContainerType.tree.fromValue()
1 parent 49f2caf commit 640b420

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ssz/type/container.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,8 @@ pub fn StructContainerType(comptime ST: type) type {
840840
}
841841

842842
pub fn fromValue(pool: *Node.Pool, value: *const Type) !Node.Id {
843-
const wrapped_ptr: *const WrappedT = @ptrCast(value);
844-
return try pool.createBranchStruct(WrappedT, wrapped_ptr);
843+
const wrapped = WrappedT{ .value = value.* };
844+
return try pool.createBranchStruct(WrappedT, &wrapped);
845845
}
846846

847847
pub fn serializeIntoBytes(node: Node.Id, pool: *Node.Pool, out: []u8) !usize {

0 commit comments

Comments
 (0)