Replace use of non-standard variable length arrays

Replace these with a std::vector for portability

Change-Id: Ia6b0dc9360446ef8bba0baa88c61b4c400fcd799
Signed-off-by: Rob Hughes <robert.hughes@arm.com>
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp
index 3e59244..2ac325c 100644
--- a/src/armnnTfLiteParser/TfLiteParser.cpp
+++ b/src/armnnTfLiteParser/TfLiteParser.cpp
@@ -426,7 +426,7 @@
     }
     else
     {
-        unsigned long shapeSignatureSize = tensorPtr->shape_signature.size();
+        size_t shapeSignatureSize = tensorPtr->shape_signature.size();
 
         // If a shape signature exists we will use that to infer dynamic tensors
         if (shapeSignatureSize != 0)
@@ -444,12 +444,12 @@
                 }
             }
 
-            bool dimMask[tensorPtr->shape_signature.size()];
+            std::unique_ptr<bool[]> dimMask = std::make_unique<bool[]>(tensorPtr->shape_signature.size());
             for (unsigned int i = 0; i < tensorPtr->shape_signature.size(); ++i)
             {
                 dimMask[i] = tensorPtr->shape_signature[i] == -1 ? false : true;
             }
-            tensorShape = TensorShape(static_cast<unsigned int>(safeShape.size()), safeShape.data(), dimMask);
+            tensorShape = TensorShape(static_cast<unsigned int>(safeShape.size()), safeShape.data(), dimMask.get());
         }
         // If there is no shape signature treat the tensor as dynamic if the shape has a size of zero
         else if (shape.size() == 0)
@@ -1170,7 +1170,7 @@
             axis = inputDimSize + axis + 1;
         }
 
-        unsigned int shape[static_cast<unsigned int>(inputDimSize) + 1];
+        std::vector<unsigned int> shape(static_cast<unsigned int>(inputDimSize) + 1);
         unsigned int inputShapeIndex = 0;
         for (unsigned int i = 0; i < static_cast<unsigned int>(inputDimSize + 1); ++i)
         {
@@ -1185,7 +1185,7 @@
             }
         }
 
-        reshapeDesc.m_TargetShape = TensorShape(static_cast<unsigned int>(inputDimSize + 1), shape);
+        reshapeDesc.m_TargetShape = TensorShape(static_cast<unsigned int>(inputDimSize + 1), shape.data());
     }
 
     IConnectableLayer* layer = m_Network->AddReshapeLayer(reshapeDesc, layerName.c_str());