1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00

fix(inspector): Fix panic when re-entering runtime ops (#25537)

Mark `op_require_break_on_next_statement` as reentrant and properly
release borrow on the `OpState`. This fixes `BorrowMut` assertions when
running with inspector + op metrics.

Fixes https://github.com/denoland/deno/issues/25515
This commit is contained in:
Divy Srivastava 2024-09-10 08:14:26 +05:30 committed by GitHub
parent 4af98fa82f
commit c4d088863e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -591,12 +591,14 @@ where
}
}
#[op2(fast)]
pub fn op_require_break_on_next_statement(state: &mut OpState) {
let inspector = state.borrow::<Rc<RefCell<JsRuntimeInspector>>>();
inspector
.borrow_mut()
.wait_for_session_and_break_on_next_statement()
#[op2(fast, reentrant)]
pub fn op_require_break_on_next_statement(state: Rc<RefCell<OpState>>) {
let inspector_rc = {
let state = state.borrow();
state.borrow::<Rc<RefCell<JsRuntimeInspector>>>().clone()
};
let mut inspector = inspector_rc.borrow_mut();
inspector.wait_for_session_and_break_on_next_statement()
}
fn url_to_file_path_string(url: &Url) -> Result<String, AnyError> {