Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/interpose.cfa

    r5ccee64 r851fd92  
    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 : Fri Mar 13 17:35:37 2020
     13// Update Count     : 178
    1414//
    1515
    1616#include <stdarg.h>                                                                             // va_start, va_end
     17#include <stdio.h>
    1718#include <string.h>                                                                             // strlen
    1819#include <unistd.h>                                                                             // _exit, getpid
     
    143144void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
    144145void abort( bool signalAbort, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ ));
     146void __abort( bool signalAbort, const char fmt[], va_list args ) __attribute__(( __nothrow__, __leaf__, __noreturn__ ));
    145147
    146148extern "C" {
     
    152154                va_list argp;
    153155                va_start( argp, fmt );
    154                 abort( false, fmt, argp );
     156                __abort( false, fmt, argp );
    155157                va_end( argp );
    156158        }
     
    218220}
    219221
    220 void abort( bool signalAbort, const char fmt[], ... ) {
     222// Cannot forward va_list.
     223void __abort( bool signalAbort, const char fmt[], va_list args ) {
    221224        void * kernel_data = kernel_abort();                            // must be done here to lock down kernel
    222225        int len;
     
    228231
    229232        assert( fmt );
    230         va_list args;
    231         va_start( args, fmt );
    232 
    233233        len = vsnprintf( abort_text, abort_text_size, fmt, args );
    234         va_end( args );
    235234        __cfaabi_bits_write( STDERR_FILENO, abort_text, len );
    236235
    237236        if ( fmt[strlen( fmt ) - 1] != '\n' ) {                         // add optional newline if missing at the end of the format text
    238                 __cfaabi_dbg_write( "\n", 1 );
     237                __cfaabi_bits_write( STDERR_FILENO, "\n", 1 );
    239238        } // if
    240239        kernel_abort_msg( kernel_data, abort_text, abort_text_size );
     
    248247        va_list args;
    249248        va_start( args, fmt );
    250         abort( false, fmt, args );
     249        __abort( false, fmt, args );
     250    // CONTROL NEVER REACHES HERE!
    251251        va_end( args );
     252}
     253
     254void abort( bool signalAbort, const char fmt[], ... ) {
     255    va_list args;
     256    va_start( args, fmt );
     257    __abort( signalAbort, fmt, args );
     258    // CONTROL NEVER REACHES HERE!
     259    va_end( args );
    252260}
    253261
Note: See TracChangeset for help on using the changeset viewer.