From ed0c1db3a8c821c592851423467ccdaedb1c9e82 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Thu, 11 Feb 2021 19:49:50 -0500 Subject: [PATCH 1/3] fix parsing of relative branch paths --- src/branch.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/branch.cpp b/src/branch.cpp index 34d79442..010ab9ea 100644 --- a/src/branch.cpp +++ b/src/branch.cpp @@ -119,7 +119,9 @@ namespace l { uint64_t offset; - offset = s_.find_first_of('/'); + offset = s_.find_first_not_of("+<>-="); + if(offset > 1) + offset = 2; *instr_ = s_.substr(0,offset); if(offset != std::string::npos) *values_ = s_.substr(offset); From bcd5fde5d8beaba94301b2f21c81ce609b0d71fc Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Sun, 20 Jun 2021 17:11:58 -0400 Subject: [PATCH 2/3] properly initialize fuse_buf in worker loop --- libfuse/lib/fuse_loop_mt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libfuse/lib/fuse_loop_mt.c b/libfuse/lib/fuse_loop_mt.c index 893ce7ae..00a0ee9c 100644 --- a/libfuse/lib/fuse_loop_mt.c +++ b/libfuse/lib/fuse_loop_mt.c @@ -79,8 +79,8 @@ fuse_do_work(void *data) struct fuse_buf fbuf; struct fuse_chan *ch = mt->prevch; - fbuf.mem = w->buf; - fbuf.size = w->bufsize; + fbuf = (struct fuse_buf){ .mem = w->buf, + .size = w->bufsize }; pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); res = fuse_session_receive_buf(mt->se, &fbuf, &ch); From c06db9c3a04effca67f2ed88fdaabc65a4da1d05 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Fri, 25 Jun 2021 09:15:44 -0400 Subject: [PATCH 3/3] pfrd: fix mod by zero error when all branches are filtered --- src/policy_eppfrd.cpp | 3 +++ src/policy_msppfrd.cpp | 3 +++ src/policy_pfrd.cpp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/policy_eppfrd.cpp b/src/policy_eppfrd.cpp index 2c38efc2..e16780d6 100644 --- a/src/policy_eppfrd.cpp +++ b/src/policy_eppfrd.cpp @@ -204,6 +204,9 @@ namespace eppfrd uint64_t idx; uint64_t threshold; + if(sum_ == 0) + return NULL; + idx = 0; threshold = RND::rand64(sum_); for(size_t i = 0; i < branchinfo_.size(); i++) diff --git a/src/policy_msppfrd.cpp b/src/policy_msppfrd.cpp index dd4f8931..cc95bca4 100644 --- a/src/policy_msppfrd.cpp +++ b/src/policy_msppfrd.cpp @@ -130,6 +130,9 @@ namespace msppfrd uint64_t idx; uint64_t threshold; + if(sum_ == 0) + return NULL; + idx = 0; threshold = RND::rand64(sum_); for(size_t i = 0; i < branchinfo_.size(); i++) diff --git a/src/policy_pfrd.cpp b/src/policy_pfrd.cpp index ab22e278..0ecf880b 100644 --- a/src/policy_pfrd.cpp +++ b/src/policy_pfrd.cpp @@ -98,6 +98,9 @@ namespace pfrd uint64_t idx; uint64_t threshold; + if(sum_ == 0) + return NULL; + idx = 0; threshold = RND::rand64(sum_); for(size_t i = 0; i < branchinfo_.size(); i++)