Changeset eeaea53


Ignore:
Timestamp:
Feb 1, 2017, 4:13:27 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
ac93b22
Parents:
511aa69
Message:

Removed undefined behavior when anonymous unions have no member

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r511aa69 reeaea53  
    449449                        TypeSubstitution sub = makeGenericSubstitutuion( sit );
    450450                        StructDecl * st = sit->get_baseStruct();
     451                        if(st->get_members().empty()) return;
    451452                        // want to resolve each initializer to the members of the struct,
    452453                        // but if there are more initializers than members we should stop
     
    458459                        TypeSubstitution sub = makeGenericSubstitutuion( uit );
    459460                        UnionDecl * un = uit->get_baseUnion();
     461                        if(un->get_members().empty()) return;
    460462                        // only resolve to the first member of a union
    461463                        resolveSingleAggrInit( *un->get_members().begin(), init, initEnd, sub );
Note: See TracChangeset for help on using the changeset viewer.