[flang] runtime: Read environment variables directly
Add support for reading environment variables directly, via std::getenv. This needs to allocate a C-style string to pass into std::getenv. If the memory allocation for that fails, we terminate. This also changes the interface for EnvVariableLength to receive the source file and line so we can crash gracefully. Note that we are now completely ignoring the envp pointer passed into ProgramStart, since that could go stale if the environment is modified during execution. Differential Revision: https://reviews.llvm.org/D111785
Loading
Please sign in to comment