0

Hi,

Here is the code

bool A::clear(void) {
    if (m_active) {
      return val;
    } else {
      return true;
    }
  } // end A::clear
  
  bool A::initialize(void) {
    if (m_active) {
      return clear();
    } else {
      return true;
    }
  } // end A::initialize

getting the below segmenation fault as soon as it enters executing the clear() function
Incurred fault #6, FLTBOUNDS %pc = 0xFFFFFD7FFDE049C4
/1: siginfo: SIGSEGV SEGV_MAPERR addr=0x1FDE73940
/1: Received signal #11, SIGSEGV [caught]
/1: siginfo: SIGSEGV SEGV_MAPERR addr=0x1FDE73940

If initialize() directly returns the val, without caling the clear(), it works.
Can some help me on this

-Champa Ananad

Edited by Nick Evan: Added CODE tags

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by champa anand
0

Val is a class variable, if the clear() function just returns true or false, not the val , still it crashes as soon as it enters the clear() function.

-Champa

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.