Skip to content

Commit d34a4bb

Browse files
committed
Fix initial executionContextId range
Avoid a Smi range exception when picking a random initial executionContextId. Not a fix for #1201, but discovered looking into the problem. Bug: 🐛 Bug Report — `workerd` sometimes doesn't send `Debugger.scriptParsed` events #1201
1 parent 630b8aa commit d34a4bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

patches/v8/0013-Randomize-the-initial-ExecutionContextId-used-by-the.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ index 60ad12aece057b4ff8eb12f99b830a4a44e12cc0..20d06e4f011714977e053b5409fb2600
1919
m_debugger(new V8Debugger(isolate, this)),
2020
m_lastExceptionId(0),
2121
- m_lastContextId(0),
22-
+ m_lastContextId(static_cast<int32_t>(generateUniqueId())),
22+
+ m_lastContextId(static_cast<int32_t>(generateUniqueId() & 0x1fff'ffe0)),
2323
m_isolateId(generateUniqueId()) {
2424
v8::debug::SetInspector(m_isolate, this);
2525
v8::debug::SetConsoleDelegate(m_isolate, console());

0 commit comments

Comments
 (0)