Ignore:
Timestamp:
Jan 22, 2015, 3:04:10 PM (5 years ago)
Author:
nmedfort
Message:

Possible fix for segfault issue. CC seems to be generating the same charclass multiple times.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/symbol_generator.cpp

    r4432 r4433  
    1717}
    1818
    19 String * SymbolGenerator::get(const std::string name) {
     19String * SymbolGenerator::get(const std::string name, const bool generated) {
    2020    auto f = mStringMap.find(name);
    2121    String * result;
    2222    if (f == mStringMap.end()) {
    23         result = new String(std::move(name));
     23        result = new String(std::move(name), generated);
    2424        mStringMap.insert(std::make_pair(name, result));
    2525    }
     
    4444}
    4545
    46 String * SymbolGenerator::make(const std::string prefix) {
     46String * SymbolGenerator::make(const std::string prefix, const bool generated) {
    4747    auto f = mPrefixMap.find(prefix);
    4848    unsigned count = 0;
    4949    if (f == mPrefixMap.end()) {
    5050        mPrefixMap.insert(std::make_pair(prefix, 1));
    51         return get(prefix);
     51        return get(prefix, generated);
    5252    }
    5353    else {
    5454        count = f->second++;
    55         return get(prefix + std::to_string(count));
     55        return get(prefix + std::to_string(count), generated);
    5656    }
    5757}
Note: See TracChangeset for help on using the changeset viewer.