ソースを参照

Merge pull request #7973 from Morph1984/debug-crash

host_memory: Fix fastmem crashes in debug builds
Fernando S 4 年 前
コミット
5192c64991
1 ファイル変更2 行追加2 行削除
  1. 2 2
      src/common/host_memory.cpp

+ 2 - 2
src/common/host_memory.cpp

@@ -327,8 +327,8 @@ private:
     bool IsNiechePlaceholder(size_t virtual_offset, size_t length) const {
         const auto it = placeholders.upper_bound({virtual_offset, virtual_offset + length});
         if (it != placeholders.end() && it->lower() == virtual_offset + length) {
-            const bool is_root = it == placeholders.begin() && virtual_offset == 0;
-            return is_root || std::prev(it)->upper() == virtual_offset;
+            return it == placeholders.begin() ? virtual_offset == 0
+                                              : std::prev(it)->upper() == virtual_offset;
         }
         return false;
     }