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/codegenstate.cpp

    r4432 r4433  
    1212
    1313Assign * PabloBlock::createAssign(const std::string prefix, PabloAST * expr, const int outputIndex)  {
    14     return insertAtInsertionPoint(new Assign(expr, outputIndex, mSymbolGenerator->make(prefix), this));
     14    return insertAtInsertionPoint(new Assign(expr, outputIndex, makeName(prefix, false), this));
    1515}
    1616
     
    3030
    3131Call * PabloBlock::createCall(String * name) {
     32    assert (name);
    3233    return insertAtInsertionPoint(new Call(name, this));
    3334}
    3435
    3536PabloAST * PabloBlock::createNot(PabloAST * expr) {
     37    assert (expr);
    3638    if (isa<Ones>(expr)) {
    3739        return createZeroes();
     
    4749
    4850Var * PabloBlock::createVar(String * name) {
     51    assert (name);
    4952    return insertAtInsertionPoint(new Var(name, this));
    5053}
     
    5356
    5457Next * PabloBlock::createNext(Assign * assign, PabloAST * expr) {
     58    assert (assign && expr);
    5559    return insertAtInsertionPoint(new Next(assign, expr, this));
    5660}
    5761
    5862PabloAST * PabloBlock::createMatchStar(PabloAST * marker, PabloAST * charclass) {
     63    assert (marker && charclass);
    5964    if (isa<Zeroes>(marker) || isa<Zeroes>(charclass)) {
    6065        return marker;
     
    6469
    6570PabloAST * PabloBlock::createScanThru(PabloAST * from, PabloAST * thru) {
     71    assert (from && thru);
    6672    if (isa<Zeroes>(from) || isa<Zeroes>(thru)) {
    6773        return from;
     
    7177
    7278PabloAST * PabloBlock::createAnd(PabloAST * expr1, PabloAST * expr2) {
     79    assert (expr1 && expr2);
    7380    if (isa<Zeroes>(expr2) || isa<Ones>(expr1)) {
    7481        return expr2;
     
    101108
    102109PabloAST * PabloBlock::createOr(PabloAST * expr1, PabloAST * expr2) {
     110    assert (expr1 && expr2);
    103111    if (isa<Zeroes>(expr2) || isa<Ones>(expr1)) {
    104112        return expr1;
     
    147155
    148156PabloAST * PabloBlock::createXor(PabloAST * expr1, PabloAST * expr2) {
     157    assert (expr1 && expr2);
    149158    if (isa<Ones>(expr1)) {
    150159        return createNot(expr2);
     
    170179
    171180PabloAST * PabloBlock::createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr) {
    172     assert (condition && trueExpr && falseExpr && pb);
     181    assert (condition && trueExpr && falseExpr);
    173182
    174183    if (isa<Ones>(condition)) {
     
    203212
    204213If * PabloBlock::createIf(PabloAST * condition, std::vector<Assign *> && definedVars, PabloBlock & body) {
     214    assert (condition);
    205215    return insertAtInsertionPoint(new If(condition, std::move(definedVars), body, this));
    206216}
    207217
    208 While * PabloBlock::createWhile(PabloAST * cond, PabloBlock & body) {
    209     return insertAtInsertionPoint(new While(cond, body, this));
     218While * PabloBlock::createWhile(PabloAST * condition, PabloBlock & body) {
     219    assert (condition);
     220    return insertAtInsertionPoint(new While(condition, body, this));
    210221}
    211222
Note: See TracChangeset for help on using the changeset viewer.