Issue 87243
Summary lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp:64: Poor error checking ?
Labels new issue
Assignees
Reporter dcb314
    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>();

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to