dex2oat: don't prune dex if passed as FD

dex2oat prunes a dex file from its internal record if the file does not
exist on the file path. This change avoids the pruning in case if the
dex is passed as FD.

Bug: 186132447
Test: odrefresh --use-compilation-os=10 --force-compile
      # complete successfully with other changes
Test: TH
Change-Id: I7dd2f0d1e100e465c2424eb36cb2d94da1e69001
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 7ca0bf2..629dee8 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -2609,7 +2609,8 @@
     DCHECK_EQ(dex_filenames_.size(), dex_locations_.size());
     size_t kept = 0u;
     for (size_t i = 0, size = dex_filenames_.size(); i != size; ++i) {
-      if (!OS::FileExists(dex_filenames_[i].c_str())) {
+      // Keep if the file exist, or is passed as FD.
+      if (!OS::FileExists(dex_filenames_[i].c_str()) && i >= dex_fds_.size()) {
         LOG(WARNING) << "Skipping non-existent dex file '" << dex_filenames_[i] << "'";
       } else {
         if (kept != i) {