summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-01-20 14:30:06 -0800
committerFangrui Song <maskray@google.com>2020-01-24 10:38:40 -0800
commit5d1fe1a1a9f18c5009e9e282b755e52c5e7ce5a2 (patch)
tree91d714b21bc6223116db128f18b1ae1f2a2fd2a8 /clang/lib/Sema/SemaDeclAttr.cpp
parent6f4edc606b2088bcac066640d5107d2042c203c1 (diff)
downloadbcm5719-llvm-5d1fe1a1a9f18c5009e9e282b755e52c5e7ce5a2.tar.gz
bcm5719-llvm-5d1fe1a1a9f18c5009e9e282b755e52c5e7ce5a2.zip
[Driver][CodeGen] Support -fpatchable-function-entry=N,M and __attribute__((patchable_function_entry(N,M))) where M>0
Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D73072 (cherry picked from commit 69bf40c45fd7f6dfe11b47de42571d8bff5ef94f)
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 5c51b0f9b8c..849bc09063b 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -4924,9 +4924,9 @@ static void handlePatchableFunctionEntryAttr(Sema &S, Decl *D,
Expr *Arg = AL.getArgAsExpr(1);
if (!checkUInt32Argument(S, AL, Arg, Offset, 1, true))
return;
- if (Offset) {
+ if (Count < Offset) {
S.Diag(getAttrLoc(AL), diag::err_attribute_argument_out_of_range)
- << &AL << 0 << 0 << Arg->getBeginLoc();
+ << &AL << 0 << Count << Arg->getBeginLoc();
return;
}
}
OpenPOWER on IntegriCloud