[PATCH] D75843: [ARM,CDE] Implement CDE feature test macros

Mikhail Maltsev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 9 08:35:26 PDT 2020


miyuki marked an inline comment as done.
miyuki added inline comments.


================
Comment at: clang/lib/Basic/Targets/ARM.cpp:492
       HW_FP |= HW_FP_SP | HW_FP_HP;
+    } else if (Feature >= "+cdecp0" && Feature <= "+cdecp7") {
+      unsigned Coproc = Feature.back() - '0';
----------------
simon_tatham wrote:
> As far as I can see, feature names have not already been checked against any whitelist of known strings by the time we get here.
> 
> So this test will catch strings like `+cdecp0sdfsdfsdf` as well as the eight strings you actually wanted.
> 
> And then the next line makes an out-of-range shift count from the last character.
Doh!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75843/new/

https://reviews.llvm.org/D75843





More information about the cfe-commits mailing list