Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-02-15 13:25:02 +0300
committerAnna Henningsen <anna@addaleax.net>2019-02-17 20:09:14 +0300
commit783c65ebc4143ed9afa723f26eaebdecf5f98691 (patch)
tree635afba4bcfa4a7447d0b7313ad3c859e6efcbd2 /src/node_errors.cc
parent586318aa9f70cdd0f5e0bc93b031ff68f572ed64 (diff)
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: https://github.com/nodejs/node/pull/26125 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r--src/node_errors.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 42e19f69051..39673abf7f0 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -710,6 +710,7 @@ void DecorateErrorStack(Environment* env,
void FatalException(Isolate* isolate,
Local<Value> error,
Local<Message> message) {
+ CHECK(!error.IsEmpty());
HandleScope scope(isolate);
Environment* env = Environment::GetCurrent(isolate);