aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 502c583..dd08d75 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5287,12 +5287,16 @@ bool Sema::CheckRISCVBuiltinFunctionCall(const TargetInfo &TI,
bool IsStore = BuiltinID == RISCV::BI__builtin_riscv_ntl_store;
unsigned NumArgs = IsStore ? 3 : 2;
- if (checkArgCount(*this, TheCall, NumArgs))
+ if (checkArgCountAtLeast(*this, TheCall, NumArgs - 1))
+ return true;
+
+ if (checkArgCountAtMost(*this, TheCall, NumArgs))
return true;
// Domain value should be compile-time constant.
// 2 <= domain <= 5
- if (SemaBuiltinConstantArgRange(TheCall, NumArgs - 1, 2, 5))
+ if (TheCall->getNumArgs() == NumArgs &&
+ SemaBuiltinConstantArgRange(TheCall, NumArgs - 1, 2, 5))
return true;
Expr *PointerArg = TheCall->getArg(0);