Skip to content

Commit 62de05d

Browse files
committedNov 14, 2019
Fix grow_ref_stack bug
1 parent f1ab2fa commit 62de05d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/hotspot/share/runtime/continuation.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -4802,7 +4802,6 @@ bool ContMirror::grow_stack(int new_size) {
48024802
int old_length = _stack_length;
48034803
int offset = _sp >= 0 ? _sp : old_length;
48044804
int min_length = (old_length - offset) + new_size;
4805-
48064805
guarantee (min_length > old_length, "");
48074806

48084807
int new_length = ensure_capacity(old_length, min_length);
@@ -4854,12 +4853,14 @@ bool ContMirror::allocate_ref_stack(int nr_oops) {
48544853
template <typename ConfigT>
48554854
bool ContMirror::grow_ref_stack(int nr_oops) {
48564855
int old_length = _ref_stack->length();
4857-
int offset = _ref_sp > 0 ? _ref_sp : old_length;
4856+
int offset = _ref_sp >= 0 ? _ref_sp : old_length;
48584857
int old_oops = old_length - offset;
48594858
int min_length = old_oops + nr_oops;
4859+
guarantee (min_length > old_length, "");
48604860

48614861
int new_length = ensure_capacity(old_length, min_length);
48624862
if (new_length == -1) {
4863+
guarantee(false, ""); // TODO handle somehow
48634864
return false;
48644865
}
48654866

0 commit comments

Comments
 (0)
Please sign in to comment.