Ignore:
Timestamp:
Aug 28, 2018, 6:28:08 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
a42a654
Parents:
d5916ce
Message:

Fix initializer of generated Destructor to use a cast to void *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    rd5916ce rb54ad9c  
    11231123                                                        if ( isCtor ) {
    11241124                                                                function->statements->push_front( callStmt );
    1125                                                         } else {
     1125                                                        } else { // TODO: don't generate destructor function/object for intrinsic calls
    11261126                                                                // destructor statements should be added at the end
    11271127                                                                // function->get_statements()->push_back( callStmt );
    11281128
    1129                                                                 // Destructor _dtor0 = { &b.a1, (void (*)(void *)_destroy_A };
     1129                                                                // __Destructor _dtor0 = { (void *)&b.a1, (void (*)(void *)_destroy_A };
    11301130                                                                std::list< Statement * > stmtsToAdd;
    11311131
     
    11341134                                                                assertf( dtorStructDestroy, "builtin __destroy_Destructor not found." );
    11351135
    1136                                                                 Expression * thisExpr = new AddressExpr( new VariableExpr( thisParam ) );
     1136                                                                Expression * thisExpr = new CastExpr( new AddressExpr( new VariableExpr( thisParam ) ), new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ) );
    11371137                                                                Expression * dtorExpr = new VariableExpr( getDtorFunc( thisParam, callStmt, stmtsToAdd ) );
    11381138
Note: See TracChangeset for help on using the changeset viewer.