[Lldb-commits] [PATCH] D86436: [lldb] Fix Type::GetByteSize for pointer types

Davide Italiano via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 24 10:15:39 PDT 2020


davide added inline comments.


================
Comment at: lldb/source/Symbol/Type.cpp:378
         m_byte_size_has_value = true;
+        return m_byte_size;
       }
----------------
shafik wrote:
> Wouldn't it be better to turn `m_byte_size` into an `Optional`? As this fix shows this having this additional state we carry around is error prone.
This is a much larger project, probably worth considering.
With that in mind, it wouldn't have prevented this bug from happening, as this falls through and returns an `Optional<T>` anyway. 
Yay fuzz testing (that found this), I would say.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86436



More information about the lldb-commits mailing list