title: Stack smashing after read operation
body: <p>I have a following snippet of code:</p>
  
  <pre><code>static uint8_t decode_uint8(const uint8_t *&amp; data)
  {
      return *(data++);
  }
  </code></pre>
  
  <p>to verify the functionality, I used the following test:</p>
  
  <pre><code>TEST(FOO, Decode8)
  {
      const uint8_t stream[] = { 0xAA, 0xBB };
  
      const uint8_t* data = &amp;stream[0];
      ASSERT_EQ(0xAA, decode_uint8(data));
      ASSERT_EQ(0xBB, decode_uint8(data));
  }
  </code></pre>
  
  <p>after which I got:</p>
  
  <pre><code>[==========] Running 1 test from 1 test suite.
  [----------] Global test environment set-up.
  [----------] 1 test from TDebugLog
  [ RUN      ] TDebugLog.Decode8
  *** stack smashing detected ***: &lt;unknown&gt; terminated
  Aborted (core dumped)
  </code></pre>
  
  <p>I've used g++8.3.0 on Ubuntu 18.04.<br>
  Any ideas why is this happening?</p>