Ignore:
Timestamp:
Mar 2, 2020, 9:34:08 PM (21 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
3d78a58, 4f0534f
Parents:
1e2de89
Message:

fix abort problem where va_list was forwarded incorrectly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/interpose.cfa

    r1e2de89 rd870df3  
    1010// Created On       : Wed Mar 29 16:10:31 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Feb 17 10:18:53 2020
    13 // Update Count     : 166
     12// Last Modified On : Mon Mar  2 17:37:00 2020
     13// Update Count     : 176
    1414//
    1515
     
    143143void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
    144144void abort( bool signalAbort, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ ));
     145void __abort( bool signalAbort, const char fmt[], va_list args ) __attribute__(( __nothrow__, __leaf__, __noreturn__ ));
    145146
    146147extern "C" {
     
    152153                va_list argp;
    153154                va_start( argp, fmt );
    154                 abort( false, fmt, argp );
     155                __abort( false, fmt, argp );
    155156                va_end( argp );
    156157        }
     
    218219}
    219220
    220 void abort( bool signalAbort, const char fmt[], ... ) {
     221// Cannot forward va_list.
     222void __abort( bool signalAbort, const char fmt[], va_list args ) {
    221223        void * kernel_data = kernel_abort();                            // must be done here to lock down kernel
    222224        int len;
     
    228230
    229231        assert( fmt );
    230         va_list args;
    231         va_start( args, fmt );
    232 
    233232        len = vsnprintf( abort_text, abort_text_size, fmt, args );
    234         va_end( args );
    235233        __cfaabi_bits_write( STDERR_FILENO, abort_text, len );
    236234
     
    248246        va_list args;
    249247        va_start( args, fmt );
    250         abort( false, fmt, args );
     248        __abort( false, fmt, args );
     249    // CONTROL NEVER REACHES HERE!
    251250        va_end( args );
     251}
     252
     253void abort( bool signalAbort, const char fmt[], ... ) {
     254    va_list args;
     255    va_start( args, fmt );
     256    __abort( signalAbort, fmt, args );
     257    // CONTROL NEVER REACHES HERE!
     258    va_end( args );
    252259}
    253260
Note: See TracChangeset for help on using the changeset viewer.