From: Jay Freeman (saurik) <saurik@saurik.com>
Date: Mon, 23 May 2011 09:07:30 +0000 (+0000)
Subject: More consistent Trampoline error handling.
X-Git-Tag: v0.9.449~3
X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/6e51aaf823ae242f0fcd656cb7753b204bfe2efb

More consistent Trampoline error handling.
---

diff --git a/Trampoline.t.cpp b/Trampoline.t.cpp
index 1d7cf95..267a253 100644
--- a/Trampoline.t.cpp
+++ b/Trampoline.t.cpp
@@ -66,10 +66,12 @@ void *Routine(void *arg) {
 
     void (*CYHandleServer)(pid_t);
     dlset(baton, CYHandleServer, "CYHandleServer", handle);
+    if (CYHandleServer == NULL) {
+        baton->dlerror();
+        return NULL;
+    }
 
-    if (CYHandleServer != NULL)
-        CYHandleServer(baton->pid);
-
+    CYHandleServer(baton->pid);
     return NULL;
 }
 
diff --git a/todo.txt b/todo.txt
index fb086d7..4613d73 100644
--- a/todo.txt
+++ b/todo.txt
@@ -39,3 +39,5 @@ don't ever generate $ CYWith, in particular for CYLet... use CYFunctionExpressio
 
 semi-colin insertion warings should mark after the previous token, not on the current one: makes a /lot/ more sense
 new for pools should take a reference, not a pointer
+
+output errors during Trampoline to some kind of log file