Changeset 5b40f30 for src/CodeGen


Ignore:
Timestamp:
Mar 15, 2016, 3:16:53 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, with_gc
Children:
dac0aa9
Parents:
972e6f7
Message:

generate correct empty list initializer, ensure function return value is not incorrectly destructed before it is returned, do not add src parameter to autogenerated routines when they take a single argument

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r972e6f7 r5b40f30  
    212212                printDesignators( init->get_designators() );
    213213                output << "{ ";
    214                 genCommaList( init->begin_initializers(), init->end_initializers() );
     214                if ( init->begin_initializers() == init->end_initializers() ) {
     215                        // illegal to leave initializer list empty for scalar initializers,
     216                        // but always legal to have 0
     217                        output << "0";
     218                } else {
     219                        genCommaList( init->begin_initializers(), init->end_initializers() );
     220                }
    215221                output << " }";
    216222        }
Note: See TracChangeset for help on using the changeset viewer.