aboutsummaryrefslogtreecommitdiff
path: root/gcc_plugin
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2019-11-15 14:46:01 +0100
committervan Hauser <vh@thc.org>2019-11-15 14:46:01 +0100
commit4b3deaf28b3219d47cf908a8f90686bd69d6aece (patch)
tree4a121f33fa05b61af4cc6b490741feef03b88207 /gcc_plugin
parentd8264390d2c4b3bbcf3ffe88511053b884f73de7 (diff)
downloadafl++-4b3deaf28b3219d47cf908a8f90686bd69d6aece.tar.gz
not all CPUs know ondemand
Diffstat (limited to 'gcc_plugin')
-rw-r--r--gcc_plugin/afl-gcc-pass.so.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc_plugin/afl-gcc-pass.so.cc b/gcc_plugin/afl-gcc-pass.so.cc
index b6246c7a..66c133b8 100644
--- a/gcc_plugin/afl-gcc-pass.so.cc
+++ b/gcc_plugin/afl-gcc-pass.so.cc
@@ -113,6 +113,7 @@ static unsigned int ext_call_instrument(function *fun) {
DECL_EXTERNAL(fndecl) = 1; /* External linkage */
DECL_ARTIFICIAL(fndecl) = 1; /* Injected by compiler */
+printf("NEW FUNC %s\n", function_name(fun));
FOR_EACH_BB_FN(bb, fun) {
gimple_seq fcall;
@@ -128,24 +129,40 @@ static unsigned int ext_call_instrument(function *fun) {
int more_than_one = -1;
edge ep;
edge_iterator eip;
+int foo = 0;
+ if (ep->flags & EDGE_FALLTHRU)
+printf("pred %d fallthough\n", foo);
FOR_EACH_EDGE(ep, eip, bb->preds) {
+int item = 0;
+foo++;
+printf("pred %d\n", foo);
+ if (ep->flags & EDGE_FALLTHRU)
+printf("pred %d fallthough\n", foo);
+
int count = 0;
+if (ep->flags & EDGE_FALLTHRU)
if (more_than_one == -1) more_than_one = 0;
basic_block Pred = ep->src;
edge es;
edge_iterator eis;
FOR_EACH_EDGE(es, eis, Pred->succs) {
+item++;
+ if (es->flags & EDGE_FALLTHRU)
+printf("item %d fallthough\n", item);
+
basic_block Succ = es->dest;
if (Succ != NULL) count++;
}
+printf("total items: %d\n", item);
if (count > 1) more_than_one = 1;
}
+printf("result: %d\n", more_than_one);
if (more_than_one != 1) continue;