Mercurial > hg > graal-jvmci-8
diff src/share/vm/opto/gcm.cpp @ 4820:cf407b7d3d78
7116050: C2/ARM: memory stomping error with DivideMcTests
Summary: Block::schedule_local() may write beyond end of ready_cnt array
Reviewed-by: never, kvn
author | roland |
---|---|
date | Wed, 25 Jan 2012 09:31:47 +0100 |
parents | 1bd45abaa507 |
children | b9a9ed0f8eeb |
line wrap: on
line diff
--- a/src/share/vm/opto/gcm.cpp Tue Jan 24 17:00:51 2012 -0800 +++ b/src/share/vm/opto/gcm.cpp Wed Jan 25 09:31:47 2012 +0100 @@ -1344,8 +1344,8 @@ // Schedule locally. Right now a simple topological sort. // Later, do a real latency aware scheduler. - int *ready_cnt = NEW_RESOURCE_ARRAY(int,C->unique()); - memset( ready_cnt, -1, C->unique() * sizeof(int) ); + uint max_idx = C->unique(); + GrowableArray<int> ready_cnt(max_idx, max_idx, -1); visited.Clear(); for (i = 0; i < _num_blocks; i++) { if (!_blocks[i]->schedule_local(this, matcher, ready_cnt, visited)) {