[clang] [Clang] Fixes builtin_bswapg builtin for bool type (PR #179177)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 4 17:47:34 PST 2026
================
@@ -1048,7 +1048,7 @@ static bool interp__builtin_bswap(InterpState &S, CodePtr OpPC,
const InterpFrame *Frame,
const CallExpr *Call) {
const APSInt &Val = popToAPSInt(S, Call->getArg(0));
- if (Val.getBitWidth() == 8)
+ if (Val.getBitWidth() == 8 || Val.getBitWidth() == 1)
----------------
woruyu wrote:
if bit widths is in 2-7, clang will crash.
https://github.com/llvm/llvm-project/pull/179177
More information about the cfe-commits
mailing list