RunThreadPlan should make sure the plan passed in is valid before running it.

<rdar://problem/13485541>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178202 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Process.cpp b/source/Target/Process.cpp
index c86bb65..4725fd0 100644
--- a/source/Target/Process.cpp
+++ b/source/Target/Process.cpp
@@ -4459,7 +4459,13 @@
         errors.Printf("RunThreadPlan called with empty thread plan.");
         return eExecutionSetupError;
     }
-
+    
+    if (!thread_plan_sp->ValidatePlan(NULL))
+    {
+        errors.Printf ("RunThreadPlan called with an invalid thread plan.");
+        return eExecutionSetupError;
+    }
+    
     if (exe_ctx.GetProcessPtr() != this)
     {
         errors.Printf("RunThreadPlan called on wrong process.");