<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87243>87243</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp:64: Poor error checking ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp:64:7: warning: Identical condition '!obj', second condition is always false [identicalConditionAfterEarlyExit]
if (!obj)
^
Source code is
if (!obj)
return obj.takeError();
PyObject *str_obj = PyObject_Str(obj.get().get());
if (!obj)
return llvm::make_error<PythonException>();
maybe better code:
if (!obj)
return obj.takeError();
PyObject *str_obj = PyObject_Str(obj.get().get());
if (!str_obj)
return llvm::make_error<PythonException>();
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVM9uoz4QfprhYjUCmwA5cKBNkHr6VcoDVP4zEKeOjWzza3n7lUnTdnvYvexKy8GMPDOfv_nsGR6CHi1iC9t72O4zPseT862SghVlJpxa2mPkUUvCLTdLQE_kNMkTyhcS-BKAdZDvIX9fjVECaB_c7CUC7Z_MPGobgPZH6fUUH21EP3mM6JN3iSdnP4w9j_w_cUYZw0ZOE7CuKoF1NbCOvHJvtR2T-ajQRi25IdJZpaN2lgCtgRZOnFfjgQRMvi8BOhBuXvkSyMBNQALbe33DebhFdUNEf-DeLIc3HWG7vxZFiB4I0OZ2wu62nT7YHr4KcFwrJ9IpJDp89fwCxWOcvSVOnDeRv-DBe-fXyB2w-1vY03LVhgDtQvTPTpwJsP3H_vMxpqQEMmK8pn9aP2P9jokx_1_SzbLuwl_wGVdC7OF6TYc3iVOSC9jhG8vreuGLQCIwxvRanMJvj-SfVOId6E-qkamWqR3b8Qzboi6KXcPqpslOLVYqV7xStG4a5Go3iKZixSAKVlW13DWZbmlOy7zMi2Kbs7zZcFZVamAqr_OhpCKHMscL12aTuG2cHzMdwoxtU9OSZYYLNGFtaUotvpLVCZSmDvdtyrkT8xigzI0OMXyiRB0Ntn-ji8mTc56s2pF1fGg7EmB9NnvTnmKc1lFCe6D9qONpFhvpLkD7Vfzr727yLuEC7deCEqG14B8BAAD__4zCdYU">