diff --git a/angr/cfg.py b/angr/cfg.py
index <HASH>..<HASH> 100644
--- a/angr/cfg.py
+++ b/angr/cfg.py
@@ -261,10 +261,14 @@ class CFG(CFGBase):
         # Start execution!
         simexit = self._project.exit_to(function_addr, state=symbolic_initial_state)
         simrun = self._project.sim_run(simexit)
-        exits = simrun.exits()
+        exits = simrun.flat_exits()
 
         if exits:
-            final_st = exits[-1].state
+            final_st = None
+            for ex in exits:
+                if ex.state.satisfiable():
+                    final_st = ex.state
+                    break
         else:
             final_st = None
 
diff --git a/tests/test_cfg.py b/tests/test_cfg.py
index <HASH>..<HASH> 100644
--- a/tests/test_cfg.py
+++ b/tests/test_cfg.py
@@ -108,6 +108,10 @@ def test_cfg_4():
     import ipdb; ipdb.set_trace()
 
 if __name__ == "__main__":
+    import sys
+
+    sys.setrecursionlimit(1000000)
+
     logging.getLogger("simuvex.plugins.abstract_memory").setLevel(logging.DEBUG)
     #logging.getLogger("simuvex.plugins.symbolic_memory").setLevel(logging.DEBUG)
     logging.getLogger("angr.cfg").setLevel(logging.DEBUG)
fixed a bug in CFG that it may use unsatisfiable state to perform symbolic execution.