diff --git a/src/BatchMaker.cpp b/src/BatchMaker.cpp index 30c4b2d7df2ec85483d7cad055df2ece66de5579..f31ce0f91dfb2367417b32ea065c84ab027fdd34 100644 --- a/src/BatchMaker.cpp +++ b/src/BatchMaker.cpp @@ -79,7 +79,6 @@ void BatchMaker::createBatchedFormFnPrototype(vector & BatchFuncArgL void BatchMaker::replaceOldArgUsesWithBatchArgs(vector & BatchFuncArgList, AllocaInst * IdxPtr) { auto EntryBB = &BatchFunc->front(); - Builder.SetInsertPoint(&EntryBB->front()); SmallVector BatchArgs; for_each(BatchFuncArgList.begin(), BatchFuncArgList.end(), @@ -87,6 +86,7 @@ void BatchMaker::replaceOldArgUsesWithBatchArgs(vector & BatchFuncAr if (Attr.IsBatch) BatchArgs.push_back(Attr.Val); }); for (auto & BatchArg : BatchArgs) { + Builder.SetInsertPoint(&EntryBB->front()); auto BatchArgAlloca = Builder.CreateAlloca(BatchArg->getType()); auto StoreI = findFirstUseInStoreInst(BatchArg); diff --git a/test/unittests/inputs/fast_flows.c b/test/unittests/inputs/fast_flows.c index 8d65af26db8205fb4cdc0b97d5b6e7b87a115a4f..6bee9e9bae0a5f5028c684b66880fb83fed94daa 100644 --- a/test/unittests/inputs/fast_flows.c +++ b/test/unittests/inputs/fast_flows.c @@ -303,6 +303,9 @@ int fast_flows_packet(struct dataplane_context *ctx, flow_id = fs - fp_state->flowst; trigger_ack = 0, fin_bump = 0; + if (fs == NULL) + return -1; + tcp_extra_hlen = (TCPH_HDRLEN(&p->tcp) - 5) * 4; payload_off = sizeof(*p) + tcp_extra_hlen; payload_bytes =