[flang-commits] [flang] 14339ab - [flang] Catch error on REPEAT(x, NCOPIES=array) (#89993)

via flang-commits flang-commits at lists.llvm.org
Wed Apr 24 15:58:01 PDT 2024


Author: Peter Klausler
Date: 2024-04-24T15:57:58-07:00
New Revision: 14339aba9ca3299f0f76999e0e8f42a7e1eacb10

URL: https://github.com/llvm/llvm-project/commit/14339aba9ca3299f0f76999e0e8f42a7e1eacb10
DIFF: https://github.com/llvm/llvm-project/commit/14339aba9ca3299f0f76999e0e8f42a7e1eacb10.diff

LOG: [flang] Catch error on REPEAT(x,NCOPIES=array) (#89993)

The NCOPIES= argument to the intrinsic function REPEAT must be a scalar
integer.

Fixes https://github.com/llvm/llvm-project/issues/89851.

Added: 
    

Modified: 
    flang/lib/Evaluate/intrinsics.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp
index f07f94b1a022c9..1b73cadb682d98 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -777,7 +777,9 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
             {"identity", SameType, Rank::scalar, Optionality::optional},
             {"ordered", AnyLogical, Rank::scalar, Optionality::optional}},
         SameType, Rank::scalar, IntrinsicClass::transformationalFunction},
-    {"repeat", {{"string", SameCharNoLen, Rank::scalar}, {"ncopies", AnyInt}},
+    {"repeat",
+        {{"string", SameCharNoLen, Rank::scalar},
+            {"ncopies", AnyInt, Rank::scalar}},
         SameCharNoLen, Rank::scalar, IntrinsicClass::transformationalFunction},
     {"reshape",
         {{"source", SameType, Rank::array}, {"shape", AnyInt, Rank::shape},


        


More information about the flang-commits mailing list