Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixGlobalInit.cc

    rf1b1e4c r7b3f66b  
    125125                std::list< Statement * > & destroyStatements = destroyFunction->get_statements()->get_kids();
    126126
     127                // if ( objDecl->get_init() == NULL ) return;
    127128                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
    128130                if ( objDecl->get_storageClass() == DeclarationNode::Extern ) return;
    129131                // C allows you to initialize objects with constant expressions
     
    144146                        init->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
    145147                        init->get_args().push_back( new VariableExpr( newObj ) );
    146                         initStatements.push_back( new ImplicitCtorDtorStmt( new ExprStmt( noLabels, init ) ) );
     148                        initStatements.push_back( new ExprStmt( noLabels, init ) );
    147149
    148150                        // add destructor calls to global destroy function
    149151                        UntypedExpr * destroy = new UntypedExpr( new NameExpr( "^?{}" ) );
    150152                        destroy->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
    151                         destroyStatements.push_front( new ImplicitCtorDtorStmt( new ExprStmt( noLabels, destroy ) ) );
     153                        destroyStatements.push_front( new ExprStmt( noLabels, destroy ) );
    152154                }
    153155        }
Note: See TracChangeset for help on using the changeset viewer.