Ignore:
Timestamp:
Dec 1, 2015, 5:13:00 PM (4 years ago)
Author:
nmedfort
Message:

Bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.h

    r4885 r4886  
    219219    virtual ~Statement() {}
    220220protected:
    221     Statement(const ClassTypeId id, std::initializer_list<PabloAST *> operands, const String * const name)
     221    explicit Statement(const ClassTypeId id, std::initializer_list<PabloAST *> operands, const String * const name)
    222222    : PabloAST(id)
    223223    , mName(name)
     
    235235        }
    236236    }
    237     Statement(const ClassTypeId id, unsigned operands, PabloAST * value, const String * const name)
     237    explicit Statement(const ClassTypeId id, const unsigned reserved, const String * const name)
    238238    : PabloAST(id)
    239239    , mName(name)
     
    241241    , mPrev(nullptr)
    242242    , mParent(nullptr)
    243     , mOperands(operands)
    244     , mOperand(reinterpret_cast<PabloAST**>(mAllocator.allocate(mOperands * sizeof(PabloAST *)))) {
    245         for (unsigned i = 0; i != operands; ++i) {
    246             assert (value);
    247             mOperand[i] = value;
    248             value->addUser(this);
    249         }
     243    , mOperands(0)
     244    , mOperand(reinterpret_cast<PabloAST**>(mAllocator.allocate(reserved * sizeof(PabloAST *)))) {
     245        std::memset(mOperand, reserved * sizeof(PabloAST *), 0);
    250246    }
    251247    template<typename iterator>
     
    339335
    340336protected:
    341     Variadic(const ClassTypeId id, std::initializer_list<PabloAST *> operands, const String * const name)
     337    explicit Variadic(const ClassTypeId id, std::initializer_list<PabloAST *> operands, const String * const name)
    342338    : Statement(id, operands, name)
    343339    , mCapacity(operands.size()) {
    344340
    345341    }
    346     Variadic(const ClassTypeId id, const unsigned operands, PabloAST * value, String * name)
    347     : Statement(id, operands, value, name)
    348     , mCapacity(operands) {
     342    explicit Variadic(const ClassTypeId id, const unsigned reserved, String * name)
     343    : Statement(id, reserved, name)
     344    , mCapacity(reserved) {
    349345
    350346    }
Note: See TracChangeset for help on using the changeset viewer.