Ignore:
Timestamp:
Nov 5, 2020, 7:25:03 PM (2 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
3febb2d
Parents:
a3f5208a
Message:

fix static init crash

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInitNew.cpp

    ra3f5208a r7d651a6  
    864864                        if ( const ast::Stmt * ctor = ctorInit->ctor ) {
    865865                                if ( objDecl->storage.is_static ) {
     866                                        addDataSectionAttribute(objDecl);
    866867                                        // originally wanted to take advantage of gcc nested functions, but
    867868                                        // we get memory errors with this approach. To remedy this, the static
     
    947948                                                objDecl->name = objDecl->name + staticNamer.newName();
    948949                                                objDecl->mangleName = Mangle::mangle( objDecl );
     950                                                objDecl->init = nullptr;
    949951
    950952                                                // xxx - temporary hack: need to return a declaration, but want to hoist the current object out of this scope
Note: See TracChangeset for help on using the changeset viewer.