Changeset d75038c for src


Ignore:
Timestamp:
Apr 5, 2016, 4:54:48 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
ae7014e
Parents:
afc1045
Message:

Fix segfault bug introduced in layout function code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    rafc1045 rd75038c  
    754754                                                // zero-length arrays are forbidden by C, so don't pass offset for empty struct
    755755                                                if ( ! argBaseStructType->get_baseStruct()->get_members().empty() ) {
    756                                                         arg = appExpr->get_args().insert( arg, new OffsetPackExpr( argBaseStructType ) );
     756                                                        arg = appExpr->get_args().insert( arg, new OffsetPackExpr( argBaseStructType->clone() ) );
    757757                                                        arg++;
    758758                                                }
     
    16411641                                        layoutCall->get_args().push_back( new NameExpr( alignofName( *param ) ) );
    16421642                                } else {
    1643                                         layoutCall->get_args().push_back( new SizeofExpr( *param ) );
    1644                                         layoutCall->get_args().push_back( new AlignofExpr( *param ) );
     1643                                        layoutCall->get_args().push_back( new SizeofExpr( (*param)->clone() ) );
     1644                                        layoutCall->get_args().push_back( new AlignofExpr( (*param)->clone() ) );
    16451645                                }
    16461646                        }
Note: See TracChangeset for help on using the changeset viewer.