In ThreadPlanCallFunction, do the Takedown right when the thread plan gets popped.  When the function call is discarded (e.g. when it crashes and discard_on_error is true) the plan gets discarded.  You need to make sure that the stack gets restored right then, and not wait till you start again and the thread plan stack is cleared.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123716 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed