Wladimir J. van der Laan fa126effc2
Avoid undefined behavior using CFlatData in CScript serialization
`&vch[vch.size()]` and even `&vch[0]` on vectors can cause assertion
errors with VC in debug mode. This is the problem mentioned in #4239.
The deeper problem with this is that we rely on undefined behavior.

- Add `begin_ptr` and `end_ptr` functions that get the beginning and end
  pointer of vector in a reliable way that copes with empty vectors and
  doesn't reference outside the vector
(see https://stackoverflow.com/questions/1339470/how-to-get-the-address-of-the-stdvector-buffer-start-most-elegantly/1339767#1339767).
- Add a convenience constructor to CFlatData that wraps a vector.

I added `begin_ptr` and `end_ptr` as separate functions as I imagine
they will be useful in more places.
2014-06-23 10:38:15 +02:00
..
2014-06-21 19:47:43 +02:00
2014-05-13 11:41:59 +02:00
2014-06-23 10:01:07 +02:00
2014-01-23 16:05:01 +01:00
2014-05-22 00:23:03 +07:00
2014-04-02 03:48:07 +02:00
2013-11-30 15:42:10 +10:00
2013-11-30 15:42:10 +10:00
2013-12-04 12:46:13 +01:00
2013-12-04 12:46:13 +01:00
2014-06-21 19:47:43 +02:00
2014-06-21 19:47:39 +02:00
2014-03-24 20:26:02 +00:00
2014-05-22 00:23:03 +07:00
2014-06-23 10:21:38 +02:00
2014-06-23 10:21:38 +02:00
2014-05-25 16:19:54 +02:00
2014-04-23 01:50:25 +02:00
2014-06-21 19:47:39 +02:00
2014-06-17 13:08:25 +02:00
2014-06-21 19:47:39 +02:00
2014-06-21 19:47:39 +02:00
2014-06-06 10:34:18 -04:00
2014-06-03 15:21:47 +02:00
2014-06-12 16:47:48 +02:00
2014-06-12 13:52:15 +02:00
2013-11-11 10:31:09 +10:00