Ignore:
Timestamp:
Sep 8, 2016, 1:09:47 PM (3 years ago)
Author:
xuedongx
Message:

bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_nullable.cpp

    r5147 r5149  
    104104        std::vector<RE*> list;
    105105        for (auto i = seq->begin(); i != seq->end(); ++i) {
    106             list.push_back(removeNullableAssertion(*i));
     106            if (!isNullable(*i)) {
     107                list.push_back(removeNullableAssertion(*i));
     108            }
    107109        }
    108110        re = makeSeq(list.begin(), list.end());
     
    129131    bool nullable = false;
    130132    if (const Seq * seq = dyn_cast<const Seq>(re)) {
    131         nullable = isa<Assertion>(seq->back()) ? true : isNullableAfterAssertion(seq->back());
     133        if (isNullable(re)) {
     134            return nullable;
     135        } else {
     136            nullable = isa<Assertion>(seq->back()) ? true : isNullableAfterAssertion(seq->back());
     137        }
    132138    } else if (const Alt * alt = dyn_cast<const Alt>(re)) {
    133139        for (const RE * re : *alt) {
Note: See TracChangeset for help on using the changeset viewer.