@@ -187,7 +187,7 @@ bool CheckFloatResult(InterpState &S, CodePtr OpPC, const Floating &Result,
187187// / Checks why the given DeclRefExpr is invalid.
188188bool CheckDeclRef (InterpState &S, CodePtr OpPC, const DeclRefExpr *DR);
189189
190- bool CheckBitcast (InterpState &S, CodePtr OpPC, unsigned IndeterminateBits ,
190+ bool CheckBitcast (InterpState &S, CodePtr OpPC, bool HasIndeterminateBits ,
191191 bool TargetIsUCharOrByte);
192192
193193// / Interpreter entry point.
@@ -205,7 +205,7 @@ bool InterpretOffsetOf(InterpState &S, CodePtr OpPC, const OffsetOfExpr *E,
205205// / actions of a __builtin_bit_cast expression when the target type
206206// / is primitive.
207207bool DoBitCast (InterpState &S, CodePtr OpPC, const Pointer &P, std::byte *Buff,
208- size_t BuffSize, unsigned &IndeterminateBits );
208+ size_t BuffSize, bool &HasIndeterminateBits );
209209
210210// / Perform a bitcast of all fields of P into the fields of DestPtr.
211211// / This performs the actions of a __builtin_bit_cast expression when
@@ -1582,12 +1582,12 @@ bool BitCast(InterpState &S, CodePtr OpPC, bool TargetIsUCharOrByte) {
15821582
15831583 size_t BuffSize = ToT::valueReprBytes (S.getCtx ());
15841584 std::vector<std::byte> Buff (BuffSize);
1585- unsigned IndeterminateBits = 0 ;
1585+ bool HasIndeterminateBits = false ;
15861586
1587- if (!DoBitCast (S, OpPC, FromPtr, Buff.data (), BuffSize, IndeterminateBits ))
1587+ if (!DoBitCast (S, OpPC, FromPtr, Buff.data (), BuffSize, HasIndeterminateBits ))
15881588 return false ;
15891589
1590- if (!CheckBitcast (S, OpPC, IndeterminateBits , TargetIsUCharOrByte))
1590+ if (!CheckBitcast (S, OpPC, HasIndeterminateBits , TargetIsUCharOrByte))
15911591 return false ;
15921592
15931593 S.Stk .push <ToT>(ToT::bitcastFromMemory (Buff.data ()));
@@ -1600,12 +1600,14 @@ inline bool BitCastFP(InterpState &S, CodePtr OpPC,
16001600 const Pointer &FromPtr = S.Stk .pop <Pointer>();
16011601
16021602 std::vector<std::byte> Buff (TargetSize);
1603- unsigned IndeterminateBits = 0 ;
1603+ bool HasIndeterminateBits = false ;
16041604
1605- if (!DoBitCast (S, OpPC, FromPtr, Buff.data (), TargetSize, IndeterminateBits))
1605+ if (!DoBitCast (S, OpPC, FromPtr, Buff.data (), TargetSize,
1606+ HasIndeterminateBits))
16061607 return false ;
16071608
1608- if (!CheckBitcast (S, OpPC, IndeterminateBits, /* TargetIsUCharOrByte=*/ false ))
1609+ if (!CheckBitcast (S, OpPC, HasIndeterminateBits,
1610+ /* TargetIsUCharOrByte=*/ false ))
16091611 return false ;
16101612
16111613 S.Stk .push <Floating>(Floating::bitcastFromMemory (Buff.data (), *Sem));
0 commit comments