--- a/hotspot/src/share/vm/adlc/formssel.hpp Tue Feb 24 09:53:20 2009 -0800
+++ b/hotspot/src/share/vm/adlc/formssel.hpp Wed Feb 25 10:53:14 2009 -0800
@@ -101,6 +101,7 @@
const char *_ins_pipe; // Instruction Scheduline description class
uint *_uniq_idx; // Indexes of unique operands
+ int _uniq_idx_length; // Length of _uniq_idx array
uint _num_uniq; // Number of unique operands
ComponentList _components; // List of Components matches MachNode's
// operand structure
@@ -257,11 +258,13 @@
void set_unique_opnds();
uint num_unique_opnds() { return _num_uniq; }
uint unique_opnds_idx(int idx) {
- if( _uniq_idx != NULL && idx > 0 )
+ if( _uniq_idx != NULL && idx > 0 ) {
+ assert(idx < _uniq_idx_length, "out of bounds");
return _uniq_idx[idx];
- else
+ } else {
return idx;
- }
+ }
+ }
// Operands which are only KILLs aren't part of the input array and
// require special handling in some cases. Their position in this