title: segmentation fault when function called repeatedly
body: <p>I am trying to run this code which for some reason crashes during execution with "Segmentation fault (core dumped)" error.When i ran this in Code::Blocks debugging mode,call stack showed me a different address for pointer after after some 130000 iterations.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  long long counter = 0;
  void test(int* ptr)
  {
      cout &lt;&lt; ptr[0];
      if (counter == 10000000)
          return;
      counter++;
      test(ptr);
  }
  int main()
  {
      int arr[2];
      arr[0] = 10;
      arr[1] = 20;
      test(&amp;(arr[0]));
      return 0;
  }
  </code></pre>