Skip to content

Commit 08f30d2

Browse files
committed
Bytecode: fix rotate; drop accidental ffs lines
1 parent ac30e63 commit 08f30d2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ static bool interp__builtin_rotate(InterpState &S, CodePtr OpPC,
719719
PrimType AmountT = *S.getContext().classify(Call->getArg(1)->getType());
720720
PrimType ValueT = *S.getContext().classify(Call->getArg(0)->getType());
721721

722+
uint64_t N = Value.countr_zero();
723+
pushInteger(S, N == Value.getBitWidth() ? 0 : N + 1, Call->getType());
722724
APSInt Amount = popToAPSInt(S.Stk, AmountT);
723725
APSInt Value = popToAPSInt(S.Stk, ValueT);
724726

0 commit comments

Comments
 (0)