未验证 提交 89ed59d8 编写于 作者: T Tim Diekmann 提交者: GitHub

Add missing allocation guard in `RawVec::grow`

上级 c49f2800
......@@ -520,6 +520,7 @@ fn grow(
Layout::array::<T>(cap).map_err(|_| CapacityOverflow)?
}
};
alloc_guard(new_layout.size())?;
let memory = if let Some((ptr, old_layout)) = self.current_memory() {
debug_assert_eq!(old_layout.align(), new_layout.align());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册