[flang-commits] [PATCH] D112698: [flang] Implement GET_ENVIRONMENT_VARIABLE(VALUE)

Diana Picus via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Oct 29 00:32:53 PDT 2021


rovka added inline comments.


================
Comment at: flang/runtime/command.cpp:61
+    const Descriptor *errmsg) {
+  assert(IsValidCharDescriptor(&value) && "Bad descriptor");
+  std::int64_t toCopy{std::min(
----------------
klausler wrote:
> Please use RUNTIME_CHECK, not assert.
We don't have a terminator around, so I just removed the assert. It's just a small static function anyway, probably won't cause that kind of trouble.


================
Comment at: flang/runtime/command.cpp:84
   if (IsValidCharDescriptor(value)) {
-    std::int64_t argLen{ArgumentLength(n)};
+    const char *arg = executionEnvironment.argv[n];
+    std::int64_t argLen{StringLength(arg)};
----------------
klausler wrote:
> Please use braces for initializers.
Sorry! Muscle memory...


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

https://reviews.llvm.org/D112698



More information about the flang-commits mailing list