File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -3964,10 +3964,13 @@ Value *ScalarExprEmitter::EmitRem(const BinOpInfo &Ops) {
39643964
39653965 if (Ops.Ty ->hasUnsignedIntegerRepresentation ())
39663966 return Builder.CreateURem (Ops.LHS , Ops.RHS , " rem" );
3967- else if (CGF.getLangOpts ().HLSL && Ops.Ty ->hasFloatingRepresentation ())
3967+
3968+ if (CGF.getLangOpts ().HLSL && Ops.Ty ->hasFloatingRepresentation ())
39683969 return Builder.CreateFRem (Ops.LHS , Ops.RHS , " rem" );
3969- else
3970- return Builder.CreateSRem (Ops.LHS , Ops.RHS , " rem" );
3970+
3971+ assert (Ops.Ty ->hasSignedIntegerRepresentation () &&
3972+ " Srem expected a signed integer representation." );
3973+ return Builder.CreateSRem (Ops.LHS , Ops.RHS , " rem" );
39713974}
39723975
39733976Value *ScalarExprEmitter::EmitOverflowCheckedBinOp (const BinOpInfo &Ops) {
You can’t perform that action at this time.
0 commit comments