Fix the macos build after D71575.
authorJim Ingham <jingham@apple.com>
Thu, 16 Jan 2020 02:10:31 +0000 (18:10 -0800)
committerJim Ingham <jingham@apple.com>
Thu, 16 Jan 2020 02:13:44 +0000 (18:13 -0800)
size_t and uint64_t are spelled slightly differently on macOS, which was
causing the compiler to error out calling std::min - since the two types have
to be the same.

I fixed this by casting the uint64_t computation to a size_t.  That's probably
not the cleanest solution, but it gets us back to building.

lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp

index 1f636b7..2c918a8 100644 (file)
@@ -367,7 +367,7 @@ DataExtractor ObjectFileWasm::ReadImageData(uint64_t offset, size_t size) {
   DataExtractor data;
   if (m_file) {
     if (offset < GetByteSize()) {
-      size = std::min(size, GetByteSize() - offset);
+      size = std::min(size, (size_t) (GetByteSize() - offset));
       auto buffer_sp = MapFileData(m_file, size, offset);
       return DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize());
     }