diff --git a/src/nfa/goughcompile.cpp b/src/nfa/goughcompile.cpp index 98031617..a23d570a 100644 --- a/src/nfa/goughcompile.cpp +++ b/src/nfa/goughcompile.cpp @@ -206,10 +206,6 @@ void makeCFG_top_edge(GoughGraph &cfg, const vector &vertices, assert(contains(src_slots, slot_id)); shared_ptr vmin = make_shared(); - if (!vmin) { - assert(0); - throw std::bad_alloc(); - } cfg[e].vars.emplace_back(vmin); final_var = vmin.get(); @@ -321,10 +317,6 @@ void makeCFG_edge(GoughGraph &cfg, const map &som_creators, DEBUG_PRINTF("bypassing min on join %u\n", slot_id); } else { shared_ptr vmin = make_shared(); - if (!vmin) { - assert(0); - throw std::bad_alloc(); - } cfg[e].vars.emplace_back(vmin); final_var = vmin.get(); diff --git a/src/nfagraph/ng_som.cpp b/src/nfagraph/ng_som.cpp index ee5a8f18..518b6ebc 100644 --- a/src/nfagraph/ng_som.cpp +++ b/src/nfagraph/ng_som.cpp @@ -2445,10 +2445,6 @@ static bool doLitHaigSom(NG &ng, const NGHolder &g, som_type som) { ue2_literal lit; shared_ptr rhs = make_shared(); - if (!rhs) { - assert(0); - throw std::bad_alloc(); - } if (!ng.cc.grey.allowLitHaig) { return false; } @@ -2513,10 +2509,6 @@ bool doHaigLitHaigSom(NG &ng, NGHolder &g, ue2_literal lit; shared_ptr rhs = make_shared(); shared_ptr lhs = make_shared(); - if (!rhs || !lhs) { - assert(0); - throw std::bad_alloc(); - } if (!splitOffBestLiteral(g, regions, &lit, &*lhs, &*rhs, ng.cc)) { return false; diff --git a/src/nfagraph/ng_violet.cpp b/src/nfagraph/ng_violet.cpp index 86cdf5ae..05a44117 100644 --- a/src/nfagraph/ng_violet.cpp +++ b/src/nfagraph/ng_violet.cpp @@ -1035,11 +1035,6 @@ bool splitRoseEdge(const NGHolder &base_graph, RoseInGraph &vg, shared_ptr lhs = make_shared(); shared_ptr rhs = make_shared(); - if (!lhs || !rhs) { - assert(0); - throw std::bad_alloc(); - } - unordered_map lhs_map; unordered_map rhs_map; @@ -1233,10 +1228,6 @@ void splitEdgesByCut(const NGHolder &h, RoseInGraph &vg, DEBUG_PRINTF("splitting on pivot %zu\n", h[pivot].index); unordered_map temp_map; shared_ptr new_lhs = make_shared(); - if (!new_lhs) { - assert(0); - throw std::bad_alloc(); - } splitLHS(h, pivot, new_lhs.get(), &temp_map); /* want to cut off paths to pivot from things other than the pivot - @@ -1318,10 +1309,7 @@ void splitEdgesByCut(const NGHolder &h, RoseInGraph &vg, if (!contains(done_rhs, adj)) { unordered_map temp_map; shared_ptr new_rhs = make_shared(); - if (!new_rhs) { - assert(0); - throw std::bad_alloc(); - } + splitRHS(h, adj, new_rhs.get(), &temp_map); remove_edge(new_rhs->start, new_rhs->accept, *new_rhs); remove_edge(new_rhs->start, new_rhs->acceptEod, *new_rhs); @@ -2293,10 +2281,7 @@ void splitEdgesForSuffix(const NGHolder &base_graph, RoseInGraph &vg, assert(!splitters.empty()); shared_ptr lhs = make_shared(); - if (!lhs) { - assert(0); - throw bad_alloc(); - } + unordered_map v_map; cloneHolder(*lhs, base_graph, &v_map); lhs->kind = NFA_INFIX; diff --git a/src/rose/rose_build_convert.cpp b/src/rose/rose_build_convert.cpp index c89c6ddd..9f1e563e 100644 --- a/src/rose/rose_build_convert.cpp +++ b/src/rose/rose_build_convert.cpp @@ -561,10 +561,7 @@ bool handleMixedPrefixCliche(const NGHolder &h, RoseGraph &g, RoseVertex v, DEBUG_PRINTF("woot?\n"); shared_ptr h_new = make_shared(); - if (!h_new) { - assert(0); - throw std::bad_alloc(); - } + unordered_map rhs_map; vector exits_vec; insert(&exits_vec, exits_vec.end(), exits);