mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 10:50:51 +08:00
mmap.c (backtrace_vector_release): Make sure freed block is aligned on 8-byte boundary.
* mmap.c (backtrace_vector_release): Make sure freed block is aligned on 8-byte boundary. From-SVN: r192945
This commit is contained in:
parent
13a6a8d23f
commit
8277de3441
@ -1,3 +1,8 @@
|
||||
2012-10-29 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
* mmap.c (backtrace_vector_release): Make sure freed block is
|
||||
aligned on 8-byte boundary.
|
||||
|
||||
2012-10-26 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
PR other/55087
|
||||
|
@ -229,8 +229,18 @@ backtrace_vector_release (struct backtrace_state *state,
|
||||
backtrace_error_callback error_callback,
|
||||
void *data)
|
||||
{
|
||||
backtrace_free (state, (char *) vec->base + vec->size, vec->alc,
|
||||
error_callback, data);
|
||||
size_t size;
|
||||
size_t alc;
|
||||
size_t aligned;
|
||||
|
||||
/* Make sure that the block that we free is aligned on an 8-byte
|
||||
boundary. */
|
||||
size = vec->size;
|
||||
alc = vec->alc;
|
||||
aligned = (size + 7) & ~ (size_t) 7;
|
||||
alc -= aligned - size;
|
||||
|
||||
backtrace_free (state, (char *) vec->base + size, alc, error_callback, data);
|
||||
vec->alc = 0;
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user