Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixGlobalInit.cc

    r7b3f66b rf1b1e4c  
    125125                std::list< Statement * > & destroyStatements = destroyFunction->get_statements()->get_kids();
    126126
    127                 // if ( objDecl->get_init() == NULL ) return;
    128127                if ( ! tryConstruct( objDecl ) ) return; // don't construct @= or designated objects
    129                 if ( objDecl->get_type()->get_isConst() ) return; // temporary: can't assign to a const variable
    130128                if ( objDecl->get_storageClass() == DeclarationNode::Extern ) return;
    131129                // C allows you to initialize objects with constant expressions
     
    146144                        init->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
    147145                        init->get_args().push_back( new VariableExpr( newObj ) );
    148                         initStatements.push_back( new ExprStmt( noLabels, init ) );
     146                        initStatements.push_back( new ImplicitCtorDtorStmt( new ExprStmt( noLabels, init ) ) );
    149147
    150148                        // add destructor calls to global destroy function
    151149                        UntypedExpr * destroy = new UntypedExpr( new NameExpr( "^?{}" ) );
    152150                        destroy->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
    153                         destroyStatements.push_front( new ExprStmt( noLabels, destroy ) );
     151                        destroyStatements.push_front( new ImplicitCtorDtorStmt( new ExprStmt( noLabels, destroy ) ) );
    154152                }
    155153        }
Note: See TracChangeset for help on using the changeset viewer.