From 35716c70ef01b18e2c4a971fd6ded77f912fe84d Mon Sep 17 00:00:00 2001 From: Alex Coyte Date: Mon, 16 Jan 2017 10:58:31 +1100 Subject: [PATCH] ensure that we add default top when creating a new infix graph --- src/nfagraph/ng_rose.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nfagraph/ng_rose.cpp b/src/nfagraph/ng_rose.cpp index 1c4163ce..7066ab27 100644 --- a/src/nfagraph/ng_rose.cpp +++ b/src/nfagraph/ng_rose.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016, Intel Corporation + * Copyright (c) 2015-2017, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -2368,12 +2368,17 @@ void makeNocaseWithPrefixMask(RoseInGraph &g, RoseInVertex v) { h[ds].char_reach = CharReach::dot(); - add_edge(h.start, ds, h); + NFAEdge e_start_to_ds = add_edge(h.start, ds, h); add_edge(ds, ds, h); add_edge(ds, h.accept, h); h[h.start].reports.insert(0); h[ds].reports.insert(0); + + if (g[u].type == RIV_LITERAL) { + h[e_start_to_ds].tops.insert(DEFAULT_TOP); + } } else { + assert(g[u].type == RIV_ANCHORED_START); add_edge(h.start, h.accept, h); h[h.start].reports.insert(0); }