Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/os.cpp @ 6982:e4f764ddb06a
7122219: Passed StringTableSize value not verified
Summary: Check that the values specified for -XX:StringTableSize are within a certain range.
Reviewed-by: dholmes, coleenp
author | hseigel |
---|---|
date | Mon, 12 Nov 2012 15:58:11 -0500 |
parents | 716c64bda5ba |
children | 80e866b1d053 |
comparison
equal
deleted
inserted
replaced
6981:8c413497f434 | 6982:e4f764ddb06a |
---|---|
574 if (size == 0) { | 574 if (size == 0) { |
575 // return a valid pointer if size is zero | 575 // return a valid pointer if size is zero |
576 // if NULL is returned the calling functions assume out of memory. | 576 // if NULL is returned the calling functions assume out of memory. |
577 size = 1; | 577 size = 1; |
578 } | 578 } |
579 | 579 if (size > size + space_before + space_after) { // Check for rollover. |
580 return NULL; | |
581 } | |
580 NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap()); | 582 NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap()); |
581 u_char* ptr = (u_char*)::malloc(size + space_before + space_after); | 583 u_char* ptr = (u_char*)::malloc(size + space_before + space_after); |
582 | 584 |
583 #ifdef ASSERT | 585 #ifdef ASSERT |
584 if (ptr == NULL) return NULL; | 586 if (ptr == NULL) return NULL; |