提交 e3b4f8e6 编写于 作者: R Ralf Jung

better error message when using NULL in to_ptr

上级 0b8c691f
......@@ -148,7 +148,8 @@ pub fn to_bits(self, target_size: Size) -> EvalResult<'tcx, u128> {
pub fn to_ptr(self) -> EvalResult<'tcx, Pointer> {
match self {
Scalar::Bits {..} => err!(ReadBytesAsPointer),
Scalar::Bits { bits: 0, .. } => err!(InvalidNullPointerUsage),
Scalar::Bits { .. } => err!(ReadBytesAsPointer),
Scalar::Ptr(p) => Ok(p),
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册