mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -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:
parent
4af98fa82f
commit
c4d088863e
1 changed files with 8 additions and 6 deletions
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue