File tree Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
163163 }
164164
165165 if (Continuation::is_return_barrier_entry (sender_pc)) {
166+ // sender_pc might be invalid so check that the frame
167+ // actually belongs to a Continuation.
168+ if (!Continuation::is_frame_in_continuation (thread, *this )) {
169+ return false ;
170+ }
166171 // If our sender_pc is the return barrier, then our "real" sender is the continuation entry
167172 frame s = Continuation::continuation_bottom_sender (thread, *this , sender_sp);
168173 sender_sp = s.sp ();
Original file line number Diff line number Diff line change @@ -122,6 +122,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
122122 address sender_pc = (address) sender_abi->lr ;
123123
124124 if (Continuation::is_return_barrier_entry (sender_pc)) {
125+ // sender_pc might be invalid so check that the frame
126+ // actually belongs to a Continuation.
127+ if (!Continuation::is_frame_in_continuation (thread, *this )) {
128+ return false ;
129+ }
125130 // If our sender_pc is the return barrier, then our "real" sender is the continuation entry
126131 frame s = Continuation::continuation_bottom_sender (thread, *this , sender_sp);
127132 sender_sp = s.sp ();
Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
158158 }
159159
160160 if (Continuation::is_return_barrier_entry (sender_pc)) {
161+ // sender_pc might be invalid so check that the frame
162+ // actually belongs to a Continuation.
163+ if (!Continuation::is_frame_in_continuation (thread, *this )) {
164+ return false ;
165+ }
161166 // If our sender_pc is the return barrier, then our "real" sender is the continuation entry
162167 frame s = Continuation::continuation_bottom_sender (thread, *this , sender_sp);
163168 sender_sp = s.sp ();
Original file line number Diff line number Diff line change @@ -154,6 +154,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
154154 }
155155
156156 if (Continuation::is_return_barrier_entry (sender_pc)) {
157+ // sender_pc might be invalid so check that the frame
158+ // actually belongs to a Continuation.
159+ if (!Continuation::is_frame_in_continuation (thread, *this )) {
160+ return false ;
161+ }
157162 // If our sender_pc is the return barrier, then our "real" sender is the continuation entry
158163 frame s = Continuation::continuation_bottom_sender (thread, *this , sender_sp);
159164 sender_sp = s.sp ();
You can’t perform that action at this time.
0 commit comments