[Lldb-commits] [PATCH] D82396: [lldb/ScriptInterpreter] Extract IO redirection logic and move it out of ScriptInterpreterPython (NFC)

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 24 09:09:42 PDT 2020


JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.


================
Comment at: lldb/source/Interpreter/ScriptInterpreter.cpp:171
+  if (!nullin) {
+    error = nullin.takeError();
+    return;
----------------
labath wrote:
> I'm pretty sure this will trigger an assertion about overwriting an unchecked error. One way to handle this would be to wrap the error in an `ErrorAsOutParameter` object, but I think it's better to replace the constructor with a static factory function returning an `Expected<unique_ptr>`.
That's how I did it at first, but I found this more elegant and compact. Maybe the `ErrorAsOutParameter` would tip the scales. I'll change it back to a factory. 


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

https://reviews.llvm.org/D82396





More information about the lldb-commits mailing list