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)
590 590
    struct iseq_compile_data_storage *storage =
591 591
	iseq->compile_data->storage_current;
592 592

  
593
    size_t mod = 0;
594

  
595
    /* The code assumes that SIZEOF_VALUE is 2 ** N,
596
     * SIZEOF_VALUE is enough for word-alignment, and
597
     * &storage->buff[0] is always word-aligned. */
598
    if ((mod = size & (size_t)(SIZEOF_VALUE - 1)) > 0) {
599
      size += (SIZEOF_VALUE - mod);
600
    }
601

  
593 602
    if (storage->pos + size > storage->size) {
594 603
	unsigned long alloc_size = storage->size * 2;
595 604