Project

General

Profile

Bug #9681 » 20141022-compile_data_alloc-word-align.patch

ngoto (Naohisa Goto), 10/21/2014 04:46 PM

View differences:

compile.c (working copy)
struct iseq_compile_data_storage *storage =
iseq->compile_data->storage_current;
size_t mod = 0;
/* The code assumes that SIZEOF_VALUE is 2 ** N,
* SIZEOF_VALUE is enough for word-alignment, and
* &storage->buff[0] is always word-aligned. */
if ((mod = size & (size_t)(SIZEOF_VALUE - 1)) > 0) {
size += (SIZEOF_VALUE - mod);
}
if (storage->pos + size > storage->size) {
unsigned long alloc_size = storage->size * 2;
(4-4/7)