Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clamp smi in fast calls by default #26506

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repository = "https://github.com/denoland/deno"

[workspace.dependencies]
deno_ast = { version = "=0.42.2", features = ["transpiling"] }
deno_core = { version = "0.314.2" }
deno_core = { version = "0.316.0" }

deno_bench_util = { version = "0.167.0", path = "./bench_util" }
deno_lockfile = "=0.23.1"
Expand Down
8 changes: 4 additions & 4 deletions ext/node/ops/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,11 @@ pub fn op_node_dh_compute_secret(
}

#[op2(fast)]
#[smi]
#[number]
pub fn op_node_random_int(
#[smi] min: i32,
#[smi] max: i32,
) -> Result<i32, AnyError> {
#[number] min: i64,
#[number] max: i64,
) -> Result<i64, AnyError> {
let mut rng = rand::thread_rng();
// Uniform distribution is required to avoid Modulo Bias
// https://en.wikipedia.org/wiki/Fisher–Yates_shuffle#Modulo_bias
Expand Down
7 changes: 7 additions & 0 deletions runtime/inspector_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ use deno_core::serde_json::Value;
use deno_core::unsync::spawn;
use deno_core::url::Url;
use deno_core::InspectorMsg;
use deno_core::InspectorSessionKind;
use deno_core::InspectorSessionOptions;
use deno_core::InspectorSessionProxy;
use deno_core::JsRuntime;
use fastwebsockets::Frame;
Expand Down Expand Up @@ -194,6 +196,11 @@ fn handle_ws_request(
let inspector_session_proxy = InspectorSessionProxy {
tx: outbound_tx,
rx: inbound_rx,
options: InspectorSessionOptions {
kind: InspectorSessionKind::NonBlocking {
wait_for_disconnect: true,
},
},
};

log::info!("Debugger session started.");
Expand Down
8 changes: 7 additions & 1 deletion runtime/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ use deno_core::CompiledWasmModuleStore;
use deno_core::Extension;
use deno_core::FeatureChecker;
use deno_core::GetErrorClassFn;
use deno_core::InspectorSessionKind;
use deno_core::InspectorSessionOptions;
use deno_core::JsRuntime;
use deno_core::LocalInspectorSession;
use deno_core::ModuleCodeString;
Expand Down Expand Up @@ -792,7 +794,11 @@ impl MainWorker {
/// was not configured to create inspector.
pub fn create_inspector_session(&mut self) -> LocalInspectorSession {
self.js_runtime.maybe_init_inspector();
self.js_runtime.inspector().borrow().create_local_session()
self.js_runtime.inspector().borrow().create_local_session(
InspectorSessionOptions {
kind: InspectorSessionKind::Blocking,
},
)
}

pub async fn run_event_loop(
Expand Down