Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cbd3cf0

Browse filesBrowse files
addaleaxrvagg
authored andcommitted
src: add debug CHECKs against empty handles
These checks were useful while investigating other issues; using empty `Local<>`s can be very un-debuggable, because that typically does not lead to assertions with debugging information but rather crashes based on accessing invalid memory. PR-URL: #26125 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent be671c3 commit cbd3cf0
Copy full SHA for cbd3cf0

File tree

Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed
Open diff view settings
Collapse file

‎src/api/callback.cc‎

Copy file name to clipboardExpand all lines: src/api/callback.cc
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ MaybeLocal<Value> InternalMakeCallback(Environment* env,
139139
Local<Value> argv[],
140140
async_context asyncContext) {
141141
CHECK(!recv.IsEmpty());
142+
#ifdef DEBUG
143+
for (int i = 0; i < argc; i++)
144+
CHECK(!argv[i].IsEmpty());
145+
#endif
146+
142147
InternalCallbackScope scope(env, recv, asyncContext);
143148
if (scope.Failed()) {
144149
return MaybeLocal<Value>();
Collapse file

‎src/node_errors.cc‎

Copy file name to clipboardExpand all lines: src/node_errors.cc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ void DecorateErrorStack(Environment* env,
710710
void FatalException(Isolate* isolate,
711711
Local<Value> error,
712712
Local<Message> message) {
713+
CHECK(!error.IsEmpty());
713714
HandleScope scope(isolate);
714715

715716
Environment* env = Environment::GetCurrent(isolate);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.