[clang] [Clang] Fix a non-effective assertion (PR #81083)
Shilei Tian via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 8 06:44:42 PST 2024
================
@@ -5908,7 +5908,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
}
}
- assert(PTy->canLosslesslyBitCastTo(FTy->getParamType(i)) &&
+ assert(ArgValue->getType()->canLosslesslyBitCastTo(PTy) &&
----------------
shiltian wrote:
`canLosslesslyBitCastTo` is supposed to be stricter than `castIsValid` but it looks too conservative. For example, it doesn't allow bitcast between `float` and `int`.
https://github.com/llvm/llvm-project/pull/81083
More information about the cfe-commits
mailing list