Changeset 1469a8a


Ignore:
Timestamp:
Dec 13, 2019, 1:46:34 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
cfaa2873
Parents:
9853d9b0
Message:

differentiate between null-pointer dereference and bad-pointer dereference in error message

Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/interpose.cfa

    r9853d9b0 r1469a8a  
    1010// Created On       : Wed Mar 29 16:10:31 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Nov 30 07:09:42 2019
    13 // Update Count     : 119
     12// Last Modified On : Fri Dec 13 13:45:21 2019
     13// Update Count     : 121
    1414//
    1515
     
    229229
    230230void sigHandler_segv( __CFA_SIGPARMS__ ) {
    231         abort( "Addressing invalid memory at location %p\n"
    232                         "Possible cause is reading outside the address space or writing to a protected area within the address space with an invalid pointer or subscript.\n",
    233                         sfp->si_addr );
     231                if ( sfp->si_addr == NULL ) {
     232                        abort( "Null pointer (0p) dereference.\n" );
     233                } else {
     234                        abort( "%s at memory location %p.\n"
     235                                   "Possible cause is reading outside the address space or writing to a protected area within the address space with an invalid pointer or subscript.\n",
     236                                   (sig == SIGSEGV ? "Segment fault" : "Bus error"), sfp->si_addr );
     237                }
    234238}
    235239
Note: See TracChangeset for help on using the changeset viewer.