[Lldb-commits] [lldb] r219771 - Make sure local var cu is non-NULL before dereferencing.

Bruce Mitchener bruce.mitchener at gmail.com
Tue Oct 14 20:56:54 PDT 2014


On Wed, Oct 15, 2014 at 10:07 AM, Jason Molenda <jmolenda at apple.com> wrote:

> Author: jmolenda
> Date: Tue Oct 14 22:07:39 2014
> New Revision: 219771
>
> URL: http://llvm.org/viewvc/llvm-project?rev=219771&view=rev
> Log:
> Make sure local var cu is non-NULL before dereferencing.
> (it was checked for NULL-ness in some places, not in others)
> clang static analyzer fixit.
>
> Modified:
>     lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
>
> Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=219771&r1=219770&r2=219771&view=diff
>
> ==============================================================================
> --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
> (original)
> +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp Tue Oct
> 14 22:07:39 2014
> @@ -555,7 +555,8 @@ static dw_offset_t DumpCallback
>          if (dumpInfo->die_offset == DW_INVALID_OFFSET)
>          {
>              // We are dumping everything
> -            cu->Dump(s);
> +            if (cu)
> +                cu->Dump(s);
>              return cu->GetFirstDIEOffset(); // Return true to parse all
> DIEs in this Compile Unit
>          }
>          else
>

This one doesn't make sense ... if you check it for cu->Dump, but the very
next line outside of the if statement is the return cu->GetFirstDIEOffset()
...

 - Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20141015/0521d662/attachment.html>


More information about the lldb-commits mailing list