[llvm] [Verifier] Check function attributes related to branch protection (NFC) (PR #70565)

Momchil Velikov via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 02:35:49 PDT 2023


================
@@ -2231,6 +2231,27 @@ void Verifier::verifyFunctionAttrs(FunctionType *FT, AttributeList Attrs,
   checkUnsignedBaseTenFuncAttr(Attrs, "patchable-function-prefix", V);
   checkUnsignedBaseTenFuncAttr(Attrs, "patchable-function-entry", V);
   checkUnsignedBaseTenFuncAttr(Attrs, "warn-stack-size", V);
+
+  if (Attrs.hasFnAttr("sign-return-adress")) {
+    StringRef S = Attrs.getFnAttr("sign-return-adress").getValueAsString();
+    if (S != "none" && S != "all" && S != "non-leaf")
+      CheckFailed("invalid value for 'sign-return-adress' attribute: " + S, V);
----------------
momchil-velikov wrote:

Fixed

https://github.com/llvm/llvm-project/pull/70565


More information about the llvm-commits mailing list