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

src: replace assert() with CHECK() #14663

Closed
wants to merge 1 commit into from

Conversation

bnoordhuis
Copy link
Member

See also #14514.

Aside: IMO, CHECK_LE, CHECK_NE, etc. don't really add much because we don't print out LHS and RHS values like V8 does, we just turn it into LHS < RHS, LHS != RHS, etc.

How about we replace them with just CHECK?

@bnoordhuis bnoordhuis requested a review from jasnell August 7, 2017 12:32
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Aug 7, 2017
@refack
Copy link
Contributor

refack commented Aug 7, 2017

+1 on removing CHECK_* Wrong grep.
Better grep turned out 681 occurrences in 54 files, IMHO not worth the churn.

Actual grep
Processing file : D:\code\node\src\async-wrap.cc
  Line 125 -   CHECK_GT(class_id, NODE_ASYNC_ID_OFFSET);
  Line 127 -   CHECK_LE(class_id - NODE_ASYNC_ID_OFFSET, AsyncWrap::PROVIDERS_LENGTH);
  Line 132 -   CHECK_GT(object->InternalFieldCount(), 0);
  Line 135 -   CHECK_NE(nullptr, wrap);
  Line 319 -   CHECK_EQ(promise->GetAlignedPointerFromInternalField(0), nullptr);
  Line 372 -   CHECK_NE(wrap, nullptr);
  Line 612 -   CHECK_NE(provider, PROVIDER_NONE);
  Line 613 -   CHECK_GE(object->InternalFieldCount(), 1);
  Line 716 -   CHECK_EQ(env()->current_async_id(), 0);
  Line 717 -   CHECK_EQ(env()->trigger_id(), 0);
  Line 733 -   CHECK_EQ(env()->current_async_id(), 0);
  Line 734 -   CHECK_EQ(env()->trigger_id(), 0);
Processing file : D:\code\node\src\base-object-inl.h
  Line  39 -   CHECK_EQ(false, handle.IsEmpty());
  Line  80 -   CHECK_GT(handle->InternalFieldCount(), 0);
Processing file : D:\code\node\src\cares_wrap.cc
  Line 179 -   CHECK_EQ(args.Length(), 0);
  Line 240 -   CHECK_EQ(false, RB_EMPTY(channel->task_list()));
  Line 595 -     CHECK_EQ(false, persistent().IsEmpty());
  Line 667 -     CHECK_EQ(0, uv_async_init(wrap->env()->event_loop(),
  Line 693 -     CHECK_EQ(0, uv_async_init(wrap->env()->event_loop(),
  Line 716 -     CHECK_NE(status, ARES_SUCCESS);
  Line 1212 -       CHECK_EQ(naddrttls, a_count);
  Line 1253 -     CHECK_EQ(aaaa_count, naddr6ttls);
  Line 1773 -   CHECK_EQ(false, args.IsConstructCall());
  Line 1817 -       CHECK_EQ(address->ai_socktype, SOCK_STREAM);
  Line 1844 -       CHECK_EQ(address->ai_socktype, SOCK_STREAM);
  Line 2038 -   CHECK_EQ(r, ARES_SUCCESS);
  Line 2047 -     CHECK_EQ(err, 0);
Processing file : D:\code\node\src\connection_wrap.cc
  Line  37 -   CHECK_NE(wrap_data, nullptr);
  Line  38 -   CHECK_EQ(&wrap_data->handle_, reinterpret_cast<UVType*>(handle));
  Line  46 -   CHECK_EQ(wrap_data->persistent().IsEmpty(), false);
  Line  80 -   CHECK_NE(req_wrap, nullptr);
  Line  82 -   CHECK_EQ(req_wrap->env(), wrap->env());
  Line  89 -   CHECK_EQ(req_wrap->persistent().IsEmpty(), false);
  Line  90 -   CHECK_EQ(wrap->persistent().IsEmpty(), false);
Processing file : D:\code\node\src\env-inl.h
  Line 130 -   CHECK_GE(async_id, 0);
  Line 131 -   CHECK_GE(trigger_id, 0);
  Line 452 -   CHECK_NE(heap_statistics_buffer_, nullptr);
  Line 457 -   CHECK_EQ(heap_statistics_buffer_, nullptr);  // Should be set only once.
  Line 462 -   CHECK_NE(heap_space_statistics_buffer_, nullptr);
  Line 467 -   CHECK_EQ(heap_space_statistics_buffer_, nullptr);  // Should be set only once.
  Line 477 -   CHECK_EQ(http_parser_buffer_, nullptr);  // Should be set only once.
  Line 486 -   CHECK_EQ(fs_stats_field_array_, nullptr);  // Should be set only once.
Processing file : D:\code\node\src\fs_event_wrap.cc
  Line  83 -   CHECK_EQ(initialized_, false);
  Line 117 -   CHECK_EQ(wrap->initialized_, false);
  Line 161 -   CHECK_EQ(wrap->persistent().IsEmpty(), false);
Processing file : D:\code\node\src\handle_wrap.cc
  Line  79 -   CHECK_EQ(false, wrap->persistent().IsEmpty());
  Line 116 -   CHECK_EQ(wrap->persistent().IsEmpty(), false);
Processing file : D:\code\node\src\inspector_agent.cc
  Line  95 -   CHECK_EQ(0, uv_sem_init(&start_io_thread_semaphore, 0));
  Line  97 -   CHECK_EQ(0, pthread_attr_init(&attr));
  Line 102 -   CHECK_EQ(0, pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN));
  Line 104 -   CHECK_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED));
  Line 108 -   CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &sigmask));
  Line 113 -   CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr));
  Line 114 -   CHECK_EQ(0, pthread_attr_destroy(&attr));
  Line 126 -   CHECK_EQ(0, pthread_sigmask(SIG_UNBLOCK, &sigmask, nullptr));
  Line 288 -   CHECK_EQ(maybe_delegate.ToChecked(), inspector->delegate());
  Line 330 -   CHECK_LT(2, info.Length());
  Line 366 -   CHECK_GT(args.Length(), 1);
  Line 485 -     CHECK_NE(timer_, nullptr);
  Line 505 -     CHECK_NE(channel_, nullptr);
  Line 538 -     CHECK_EQ(channel_, nullptr);
  Line 549 -     CHECK_NE(channel_, nullptr);
  Line 631 -   CHECK_EQ(0, uv_async_init(uv_default_loop(),
  Line 650 -   CHECK_NE(client_, nullptr);
  Line 702 -   CHECK_NE(client_, nullptr);
  Line 717 -   CHECK_NE(client_, nullptr);
  Line 722 -   CHECK_NE(client_, nullptr);
  Line 727 -   CHECK_NE(client_, nullptr);
  Line 732 -   CHECK_NE(client_, nullptr);
Processing file : D:\code\node\src\inspector_io.cc
  Line  48 -       CHECK_NE(req.ptr, nullptr);
  Line 205 -   CHECK_EQ(0, uv_async_init(env->event_loop(), &main_thread_req_->first,
  Line 208 -   CHECK_EQ(0, uv_sem_init(&thread_start_sem_, 0));
  Line 218 -   CHECK_EQ(state_, State::kNew);
  Line 219 -   CHECK_EQ(uv_thread_create(&thread_, InspectorIo::ThreadMain, this), 0);
  Line 236 -   CHECK_EQ(err, 0);
  Line 299 -   CHECK_EQ(err, 0);
  Line 302 -   CHECK_EQ(err, 0);
  Line 312 -     CHECK_EQ(0, CloseAsyncAndLoop(&thread_req_));
  Line 322 -   CHECK_EQ(uv_loop_close(&loop), 0);
  Line 352 -     CHECK_EQ(0, uv_async_send(&main_thread_req_->first));
  Line 393 -         CHECK_EQ(session_delegate_, nullptr);
  Line 402 -         CHECK_NE(session_delegate_, nullptr);
  Line 435 -   CHECK_EQ(0, err);
Processing file : D:\code\node\src\inspector_socket.cc
  Line 160 -     CHECK_EQ(0, remaining);
  Line 309 -     CHECK_GE(buffer.len, len);
  Line 547 -   CHECK_NE(state, nullptr);
  Line 564 -   CHECK_NE(callback, nullptr);
  Line 565 -   CHECK_EQ(socket->http_parsing_state, nullptr);
Processing file : D:\code\node\src\inspector_socket_server.cc
  Line 133 -   CHECK_EQ(Z_OK, inflateInit(&strm));
  Line 143 -   CHECK_EQ(Z_STREAM_END, inflate(&strm, Z_FINISH));
  Line 144 -   CHECK_EQ(0, strm.avail_out);
  Line 145 -   CHECK_EQ(Z_OK, inflateEnd(&strm));
  Line 391 -   CHECK_EQ(state_, ServerState::kNew);
  Line 434 -   CHECK_EQ(state_, ServerState::kRunning);
  Line 470 -   CHECK_EQ(state_, ServerState::kStopping);
  Line 502 -   CHECK_NE(state_, State::kClosing);
  Line 553 -   CHECK_EQ(State::kClosing, session->state_);
  Line 558 -   CHECK_EQ(State::kHttp, state_);
  Line 604 -   CHECK_EQ(0, uv_tcp_init(loop, server));
Processing file : D:\code\node\src\js_stream.cc
  Line  92 -   CHECK_EQ(send_handle, nullptr);
Processing file : D:\code\node\src\node.cc
  Line 348 -   CHECK_GT(n, 0);
  Line 1303 -   CHECK_EQ(env->context(), env->isolate()->GetCurrentContext());
  Line 1363 -   CHECK_EQ(env->current_async_id(), asyncContext.async_id);
  Line 1364 -   CHECK_EQ(env->trigger_id(), asyncContext.trigger_async_id);
  Line 1561 -   CHECK_NE(encoding, UCS2);
  Line 1666 -   CHECK_GE(off, 0);
  Line 1676 -     CHECK_LT(off, max_off);
  Line 1683 -     CHECK_LT(off, max_off);
  Line 1686 -   CHECK_LE(off, max_off);
  Line 2328 -       CHECK_EQ(0, sigaction(nr, &act, nullptr));
  Line 2371 -   CHECK_EQ(array->Length(), 4);
  Line 2440 -   CHECK_EQ(array->Length(), 2);
  Line 2500 -   CHECK_EQ(modpending, nullptr);
  Line 2745 -     CHECK_EQ(mod->nm_register_func, nullptr);
  Line 2746 -     CHECK_NE(mod->nm_context_register_func, nullptr);
  Line 3530 -   CHECK_EQ(sigaction(signo, &sa, nullptr), 0);
  Line 4053 -   CHECK_EQ(sigaction(signal, &sa, nullptr), 0);
  Line 4211 -   CHECK_EQ(err, 0);
  Line 4226 -     CHECK_EQ(0, sigaction(nr, &act, nullptr));
  Line 4429 -   CHECK_NE(env, nullptr);
  Line 4510 -   CHECK_EQ(0, uv_key_create(&thread_local_env));
  Line 4594 -     CHECK_EQ(node_isolate, nullptr);
  Line 4609 -     CHECK_EQ(node_isolate, isolate);
  Line 4622 -   CHECK_GT(argc, 0);
Processing file : D:\code\node\src\node_api.cc
  Line  72 - #define CHECK_ENV(env)        \
  Line  77 - #define CHECK_ARG(env, arg) \
  Line  80 - #define CHECK_MAYBE_EMPTY(env, maybe, status) \
  Line  83 - #define CHECK_MAYBE_NOTHING(env, maybe, status) \
  Line  88 -   CHECK_ENV((env));                                              \
  Line  94 - #define CHECK_TO_TYPE(env, type, context, result, src, status)                \
  Line  96 -     CHECK_ARG((env), (src));                                                  \
  Line  98 -     CHECK_MAYBE_EMPTY((env), maybe, (status));                                \
  Line 102 - #define CHECK_TO_FUNCTION(env, result, src)                                 \
  Line 104 -     CHECK_ARG((env), (src));                                                \
  Line 110 - #define CHECK_TO_OBJECT(env, context, result, src) \
  Line 111 -   CHECK_TO_TYPE((env), Object, (context), (result), (src), napi_object_expected)
  Line 113 - #define CHECK_TO_STRING(env, context, result, src) \
  Line 114 -   CHECK_TO_TYPE((env), String, (context), (result), (src), napi_string_expected)
  Line 116 - #define CHECK_TO_NUMBER(env, context, result, src) \
  Line 117 -   CHECK_TO_TYPE((env), Number, (context), (result), (src), napi_number_expected)
  Line 119 - #define CHECK_TO_BOOL(env, context, result, src)            \
  Line 120 -   CHECK_TO_TYPE((env), Boolean, (context), (result), (src), \
  Line 123 - #define CHECK_NEW_FROM_UTF8_LEN(env, result, str, len)                   \
  Line 127 -     CHECK_MAYBE_EMPTY((env), str_maybe, napi_generic_failure);           \
  Line 131 - #define CHECK_NEW_FROM_UTF8(env, result, str) \
  Line 132 -   CHECK_NEW_FROM_UTF8_LEN((env), (result), (str), -1)
  Line 236 -     CHECK_NEW_FROM_UTF8(env, *result, p->utf8name);
  Line 823 -   CHECK_ENV(env);
  Line 845 -   CHECK_ENV(env);
  Line 846 -   CHECK_ARG(env, result);
  Line 877 -   CHECK_ARG(env, result);
  Line 878 -   CHECK_ARG(env, cb);
  Line 893 -   CHECK_MAYBE_EMPTY(env, maybe_function, napi_generic_failure);
  Line 899 -     CHECK_NEW_FROM_UTF8(env, name_string, utf8name);
  Line 916 -   CHECK_ARG(env, result);
  Line 917 -   CHECK_ARG(env, constructor);
  Line 931 -   CHECK_NEW_FROM_UTF8(env, name_string, utf8name);
  Line 1015 -   CHECK_ARG(env, result);
  Line 1020 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1024 -   CHECK_MAYBE_EMPTY(env, maybe_propertynames, napi_generic_failure);
  Line 1036 -   CHECK_ARG(env, key);
  Line 1037 -   CHECK_ARG(env, value);
  Line 1043 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1059 -   CHECK_ARG(env, result);
  Line 1060 -   CHECK_ARG(env, key);
  Line 1066 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1071 -   CHECK_MAYBE_NOTHING(env, has_maybe, napi_generic_failure);
  Line 1082 -   CHECK_ARG(env, key);
  Line 1083 -   CHECK_ARG(env, result);
  Line 1090 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1094 -   CHECK_MAYBE_EMPTY(env, get_maybe, napi_generic_failure);
  Line 1106 -   CHECK_ARG(env, key);
  Line 1113 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1115 -   CHECK_MAYBE_NOTHING(env, delete_maybe, napi_generic_failure);
  Line 1128 -   CHECK_ARG(env, key);
  Line 1134 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1138 -   CHECK_MAYBE_NOTHING(env, has_maybe, napi_generic_failure);
  Line 1149 -   CHECK_ARG(env, value);
  Line 1155 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1158 -   CHECK_NEW_FROM_UTF8(env, key, utf8name);
  Line 1173 -   CHECK_ARG(env, result);
  Line 1179 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1182 -   CHECK_NEW_FROM_UTF8(env, key, utf8name);
  Line 1186 -   CHECK_MAYBE_NOTHING(env, has_maybe, napi_generic_failure);
  Line 1197 -   CHECK_ARG(env, result);
  Line 1203 -   CHECK_NEW_FROM_UTF8(env, key, utf8name);
  Line 1207 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1211 -   CHECK_MAYBE_EMPTY(env, get_maybe, napi_generic_failure);
  Line 1223 -   CHECK_ARG(env, value);
  Line 1229 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1244 -   CHECK_ARG(env, result);
  Line 1250 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1254 -   CHECK_MAYBE_NOTHING(env, has_maybe, napi_generic_failure);
  Line 1265 -   CHECK_ARG(env, result);
  Line 1271 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1275 -   CHECK_MAYBE_EMPTY(env, get_maybe, napi_generic_failure);
  Line 1291 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1293 -   CHECK_MAYBE_NOTHING(env, delete_maybe, napi_generic_failure);
  Line 1307 -     CHECK_ARG(env, properties);
  Line 1314 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1380 -   CHECK_ENV(env);
  Line 1381 -   CHECK_ARG(env, value);
  Line 1382 -   CHECK_ARG(env, result);
  Line 1394 -   CHECK_ARG(env, value);
  Line 1395 -   CHECK_ARG(env, result);
  Line 1411 -   CHECK_ARG(env, lhs);
  Line 1412 -   CHECK_ARG(env, rhs);
  Line 1413 -   CHECK_ARG(env, result);
  Line 1426 -   CHECK_ARG(env, result);
  Line 1432 -   CHECK_TO_OBJECT(env, context, obj, object);
  Line 1441 -   CHECK_ARG(env, result);
  Line 1451 -   CHECK_ARG(env, result);
  Line 1463 -   CHECK_ARG(env, result);
  Line 1476 -   CHECK_ARG(env, result);
  Line 1484 -   CHECK_MAYBE_EMPTY(env, str_maybe, napi_generic_failure);
  Line 1495 -   CHECK_ARG(env, result);
  Line 1498 -   CHECK_NEW_FROM_UTF8_LEN(env, s, str, length);
  Line 1509 -   CHECK_ARG(env, result);
  Line 1517 -   CHECK_MAYBE_EMPTY(env, str_maybe, napi_generic_failure);
  Line 1527 -   CHECK_ARG(env, result);
  Line 1536 -   CHECK_ENV(env);
  Line 1537 -   CHECK_ARG(env, result);
  Line 1554 -   CHECK_ARG(env, result);
  Line 1585 -       CHECK_NEW_FROM_UTF8(env, code_value, code_cstring);
  Line 1589 -     CHECK_NEW_FROM_UTF8(env, code_key, "code");
  Line 1599 -     CHECK_NEW_FROM_UTF8(env, name_string, "");
  Line 1601 -     CHECK_NEW_FROM_UTF8(env, name_key, "name");
  Line 1629 -   CHECK_ARG(env, msg);
  Line 1630 -   CHECK_ARG(env, result);
  Line 1650 -   CHECK_ARG(env, msg);
  Line 1651 -   CHECK_ARG(env, result);
  Line 1671 -   CHECK_ARG(env, msg);
  Line 1672 -   CHECK_ARG(env, result);
  Line 1692 -   CHECK_ENV(env);
  Line 1693 -   CHECK_ARG(env, value);
  Line 1694 -   CHECK_ARG(env, result);
  Line 1729 -   CHECK_ENV(env);
  Line 1730 -   CHECK_ARG(env, result);
  Line 1739 -   CHECK_ENV(env);
  Line 1740 -   CHECK_ARG(env, result);
  Line 1757 -   CHECK_ENV(env);
  Line 1758 -   CHECK_ARG(env, cbinfo);
  Line 1764 -     CHECK_ARG(env, argc);
  Line 1784 -   CHECK_ENV(env);
  Line 1785 -   CHECK_ARG(env, cbinfo);
  Line 1786 -   CHECK_ARG(env, result);
  Line 1802 -   CHECK_ARG(env, recv);
  Line 1804 -     CHECK_ARG(env, argv);
  Line 1813 -   CHECK_TO_FUNCTION(env, v8func, func);
  Line 1822 -       CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
  Line 1830 -   CHECK_ENV(env);
  Line 1831 -   CHECK_ARG(env, result);
  Line 1845 -   CHECK_ARG(env, error);
  Line 1862 -   CHECK_NEW_FROM_UTF8(env, str, msg);
  Line 1881 -   CHECK_NEW_FROM_UTF8(env, str, msg);
  Line 1900 -   CHECK_NEW_FROM_UTF8(env, str, msg);
  Line 1915 -   CHECK_ENV(env);
  Line 1916 -   CHECK_ARG(env, value);
  Line 1917 -   CHECK_ARG(env, result);
  Line 1930 -   CHECK_ENV(env);
  Line 1931 -   CHECK_ARG(env, value);
  Line 1932 -   CHECK_ARG(env, result);
  Line 1947 -   CHECK_ENV(env);
  Line 1948 -   CHECK_ARG(env, value);
  Line 1949 -   CHECK_ARG(env, result);
  Line 1972 -   CHECK_ENV(env);
  Line 1973 -   CHECK_ARG(env, value);
  Line 1974 -   CHECK_ARG(env, result);
  Line 1997 -   CHECK_ENV(env);
  Line 1998 -   CHECK_ARG(env, value);
  Line 1999 -   CHECK_ARG(env, result);
  Line 2028 -   CHECK_ENV(env);
  Line 2029 -   CHECK_ARG(env, value);
  Line 2030 -   CHECK_ARG(env, result);
  Line 2053 -   CHECK_ENV(env);
  Line 2054 -   CHECK_ARG(env, value);
  Line 2060 -     CHECK_ARG(env, result);
  Line 2089 -   CHECK_ENV(env);
  Line 2090 -   CHECK_ARG(env, value);
  Line 2096 -     CHECK_ARG(env, result);
  Line 2125 -   CHECK_ENV(env);
  Line 2126 -   CHECK_ARG(env, value);
  Line 2132 -     CHECK_ARG(env, result);
  Line 2153 -   CHECK_ARG(env, value);
  Line 2154 -   CHECK_ARG(env, result);
  Line 2159 -   CHECK_TO_OBJECT(env, context, obj, value);
  Line 2169 -   CHECK_ARG(env, value);
  Line 2170 -   CHECK_ARG(env, result);
  Line 2176 -   CHECK_TO_BOOL(env, context, b, value);
  Line 2186 -   CHECK_ARG(env, value);
  Line 2187 -   CHECK_ARG(env, result);
  Line 2193 -   CHECK_TO_NUMBER(env, context, num, value);
  Line 2203 -   CHECK_ARG(env, value);
  Line 2204 -   CHECK_ARG(env, result);
  Line 2210 -   CHECK_TO_STRING(env, context, str, value);
  Line 2223 -   CHECK_ARG(env, js_object);
  Line 2241 -   CHECK_MAYBE_EMPTY(env, maybe_object, napi_generic_failure);
  Line 2260 -     CHECK_ARG(env, finalize_cb);
  Line 2276 -   CHECK_ENV(env);
  Line 2277 -   CHECK_ARG(env, js_object);
  Line 2278 -   CHECK_ARG(env, result);
  Line 2302 -   CHECK_ARG(env, result);
  Line 2326 -   CHECK_ENV(env);
  Line 2327 -   CHECK_ARG(env, value);
  Line 2328 -   CHECK_ARG(env, result);
  Line 2346 -   CHECK_ENV(env);
  Line 2347 -   CHECK_ARG(env, value);
  Line 2348 -   CHECK_ARG(env, result);
  Line 2362 -   CHECK_ENV(env);
  Line 2363 -   CHECK_ARG(env, ref);
  Line 2378 -   CHECK_ENV(env);
  Line 2379 -   CHECK_ARG(env, ref);
  Line 2398 -   CHECK_ENV(env);
  Line 2399 -   CHECK_ARG(env, ref);
  Line 2424 -   CHECK_ENV(env);
  Line 2425 -   CHECK_ARG(env, ref);
  Line 2426 -   CHECK_ARG(env, result);
  Line 2437 -   CHECK_ENV(env);
  Line 2438 -   CHECK_ARG(env, result);
  Line 2448 -   CHECK_ENV(env);
  Line 2449 -   CHECK_ARG(env, scope);
  Line 2460 -   CHECK_ENV(env);
  Line 2461 -   CHECK_ARG(env, result);
  Line 2473 -   CHECK_ENV(env);
  Line 2474 -   CHECK_ARG(env, scope);
  Line 2486 -   CHECK_ENV(env);
  Line 2487 -   CHECK_ARG(env, scope);
  Line 2488 -   CHECK_ARG(env, escapee);
  Line 2489 -   CHECK_ARG(env, result);
  Line 2507 -   CHECK_ARG(env, constructor);
  Line 2509 -     CHECK_ARG(env, argv);
  Line 2511 -   CHECK_ARG(env, result);
  Line 2517 -   CHECK_TO_FUNCTION(env, ctor, constructor);
  Line 2522 -   CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
  Line 2533 -   CHECK_ARG(env, object);
  Line 2534 -   CHECK_ARG(env, result);
  Line 2542 -   CHECK_TO_OBJECT(env, context, ctor, constructor);
  Line 2608 -   CHECK_NEW_FROM_UTF8(env, prototype_string, "prototype");
  Line 2611 -   CHECK_MAYBE_EMPTY(env, maybe_prototype, napi_generic_failure);
  Line 2624 -   CHECK_MAYBE_EMPTY(env, maybe_ctor, napi_generic_failure);
  Line 2638 -       CHECK_TO_OBJECT(env, context, obj, v8impl::JsValueFromV8LocalValue(
  Line 2654 -   CHECK_ARG(env, recv);
  Line 2656 -     CHECK_ARG(env, argv);
  Line 2663 -   CHECK_TO_OBJECT(env, context, v8recv, recv);
  Line 2666 -   CHECK_TO_FUNCTION(env, v8func, func);
  Line 2683 -   CHECK_ENV(env);
  Line 2684 -   CHECK_ARG(env, result);
  Line 2694 -   CHECK_ENV(env);
  Line 2695 -   CHECK_ARG(env, result);
  Line 2713 -   CHECK_ARG(env, result);
  Line 2717 -   CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
  Line 2737 -   CHECK_ARG(env, result);
  Line 2751 -   CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
  Line 2767 -   CHECK_ARG(env, result);
  Line 2772 -   CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
  Line 2785 -   CHECK_ENV(env);
  Line 2786 -   CHECK_ARG(env, value);
  Line 2787 -   CHECK_ARG(env, result);
  Line 2798 -   CHECK_ARG(env, value);
  Line 2814 -   CHECK_ENV(env);
  Line 2815 -   CHECK_ARG(env, value);
  Line 2816 -   CHECK_ARG(env, result);
  Line 2829 -   CHECK_ARG(env, result);
  Line 2852 -   CHECK_ARG(env, result);
  Line 2878 -   CHECK_ENV(env);
  Line 2879 -   CHECK_ARG(env, arraybuffer);
  Line 2899 -   CHECK_ENV(env);
  Line 2900 -   CHECK_ARG(env, value);
  Line 2901 -   CHECK_ARG(env, result);
  Line 2916 -   CHECK_ARG(env, arraybuffer);
  Line 2917 -   CHECK_ARG(env, result);
  Line 2968 -   CHECK_ENV(env);
  Line 2969 -   CHECK_ARG(env, typedarray);
  Line 3025 -   CHECK_ARG(env, arraybuffer);
  Line 3026 -   CHECK_ARG(env, result);
  Line 3040 -   CHECK_ENV(env);
  Line 3041 -   CHECK_ARG(env, value);
  Line 3042 -   CHECK_ARG(env, result);
  Line 3056 -   CHECK_ENV(env);
  Line 3057 -   CHECK_ARG(env, dataview);
  Line 3086 -   CHECK_ENV(env);
  Line 3087 -   CHECK_ARG(env, result);
  Line 3196 -   CHECK_ENV(env);
  Line 3197 -   CHECK_ARG(env, execute);
  Line 3198 -   CHECK_ARG(env, result);
  Line 3208 -   CHECK_ENV(env);
  Line 3209 -   CHECK_ARG(env, work);
  Line 3217 -   CHECK_ENV(env);
  Line 3218 -   CHECK_ARG(env, work);
  Line 3237 -   CHECK_ENV(env);
  Line 3238 -   CHECK_ARG(env, work);
Processing file : D:\code\node\src\node_buffer.cc
  Line 141 -   CHECK_EQ(data_, static_cast<char*>(obj_c.Data()));
  Line 143 -     CHECK_NE(data_, nullptr);
  Line 340 -     CHECK_NE(data, nullptr);
  Line 423 -     CHECK_NE(data, nullptr);
  Line 725 -   CHECK_LE(offset + sizeof(T), ts_obj_length);
  Line 779 -     CHECK_NE(ts_obj_data, nullptr);
  Line 885 -   CHECK_LE(source_start, source_end);
  Line 886 -   CHECK_LE(target_start, target_end);
  Line 998 -   CHECK_LT(offset, haystack_length);
  Line 1111 -   CHECK_LT(offset, haystack_length);
  Line 1162 -   CHECK_LT(offset, ts_obj_length);
  Line 1207 -   CHECK_GE(args.Length(), 1);
Processing file : D:\code\node\src\node_constants.cc
  Line 860 - #ifdef SSL_OP_PKCS1_CHECK_1
  Line 861 -     NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_1);
  Line 864 - #ifdef SSL_OP_PKCS1_CHECK_2
  Line 865 -     NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_2);
  Line 952 - #ifdef DH_CHECK_P_NOT_SAFE_PRIME
  Line 953 -     NODE_DEFINE_CONSTANT(target, DH_CHECK_P_NOT_SAFE_PRIME);
  Line 956 - #ifdef DH_CHECK_P_NOT_PRIME
  Line 957 -     NODE_DEFINE_CONSTANT(target, DH_CHECK_P_NOT_PRIME);
  Line 960 - #ifdef DH_UNABLE_TO_CHECK_GENERATOR
  Line 961 -     NODE_DEFINE_CONSTANT(target, DH_UNABLE_TO_CHECK_GENERATOR);
Processing file : D:\code\node\src\node_crypto.cc
  Line 291 -     CHECK_GE(status, 0);  // Cannot fail.
  Line 545 -   CHECK_EQ(*issuer, nullptr);
  Line 546 -   CHECK_EQ(*cert, nullptr);
  Line 745 -       CHECK_NE(x509, nullptr);
  Line 829 -                        X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
  Line 1547 -   CHECK_EQ(arraysize(nids), arraysize(keys));
  Line 1557 -     CHECK_NE(ext, nullptr);
  Line 1561 -       CHECK_EQ(rv, 1);
  Line 1780 -   CHECK_NE(cert, nullptr);
  Line 1805 -   CHECK_GT(slen, 0);
  Line 1970 -   CHECK_NE(w->ssl_, nullptr);
  Line 2345 -     CHECK_EQ(r, 0);
  Line 2552 -   CHECK_EQ(SSL_set_SSL_CTX(ssl_, sc->ctx_), sc->ctx_);
  Line 2709 -   CHECK_EQ(error->BooleanValue(), false);
  Line 2828 -   CHECK_NE(chain, nullptr);
  Line 2829 -   CHECK_GT(sk_X509_num(chain), 0);
  Line 2837 -     CHECK_NE(root_cert, nullptr);
  Line 2844 -     return CHECK_CERT_REVOKED;
  Line 2860 -       return CHECK_CERT_REVOKED;
  Line 2865 -   return CHECK_OK;
  Line 2873 -     return CHECK_OK;
  Line 2880 -     return CHECK_OK;
  Line 2885 -   if (ret == CHECK_CERT_REVOKED)
  Line 3334 -   CHECK_EQ(initialised_, false);
  Line 3457 -   CHECK_EQ(initialised_, true);
  Line 3631 -     CHECK_EQ(r, 1);
  Line 3700 -   CHECK_EQ(initialised_, false);
  Line 3841 -   CHECK_EQ(initialised_, false);
  Line 4016 -   CHECK_EQ(initialised_, false);
  Line 4259 -   CHECK_EQ(initialised_, false);
  Line 4852 -       if (checkResult & DH_CHECK_PUBKEY_TOO_SMALL) {
  Line 4854 -       } else if (checkResult & DH_CHECK_PUBKEY_TOO_LARGE) {
  Line 4867 -   CHECK_GE(size, 0);
  Line 4907 -   CHECK_NE(*num, nullptr);
  Line 5064 -   CHECK_EQ(args.Length(), 1);
  Line 5154 -   CHECK_NE(priv_key, nullptr);
  Line 5157 -   CHECK_NE(pub, nullptr);
  Line 5196 -   CHECK_NE(group_, nullptr);
  Line 5197 -   CHECK_NE(private_key, nullptr);
  Line 5204 -   CHECK_NE(order, nullptr);
  Line 5326 -   CHECK_EQ(status, 0);
  Line 5573 -       CHECK_LE(req->size(), Buffer::Length(buffer));
  Line 5585 -   CHECK_EQ(status, 0);
  Line 5837 -   CHECK_NE(data, nullptr);
  Line 5899 -   CHECK_NE(data, nullptr);
  Line 5940 -   CHECK_NE(data, nullptr);
  Line 5990 -       CHECK_NE(err, 0);
Processing file : D:\code\node\src\node_crypto.h
  Line  81 -   CHECK_CERT_REVOKED = 0,
  Line  82 -   CHECK_OK = 1
  Line 196 -     CHECK_NE(ssl_, nullptr);
  Line 721 -     CHECK_NE(group_, nullptr);
Processing file : D:\code\node\src\node_crypto_bio.cc
  Line 271 -     CHECK_LE(read_head_->read_pos_, read_head_->write_pos_);
  Line 288 -   CHECK_EQ(expected, bytes_read);
  Line 310 -     CHECK_NE(cur, write_head_);
  Line 311 -     CHECK_EQ(cur->write_pos_, cur->read_pos_);
  Line 328 -     CHECK_LE(current->read_pos_, current->write_pos_);
  Line 355 -   CHECK_EQ(max, bytes_read);
  Line 370 -     CHECK_LE(write_head_->write_pos_, write_head_->len_);
  Line 386 -     CHECK_LE(write_head_->write_pos_, write_head_->len_);
  Line 390 -       CHECK_EQ(write_head_->write_pos_, write_head_->len_);
  Line 399 -   CHECK_EQ(left, 0);
  Line 419 -   CHECK_LE(write_head_->write_pos_, write_head_->len_);
  Line 473 -   CHECK_EQ(length_, 0);
Processing file : D:\code\node\src\node_crypto_bio.h
  Line 105 -     CHECK_NE(bio->ptr, nullptr);
Processing file : D:\code\node\src\node_crypto_clienthello-inl.h
  Line  52 -   CHECK_NE(onhello_cb, nullptr);
Processing file : D:\code\node\src\node_file.cc
  Line 167 -   CHECK_EQ(req_wrap->req(), req);
  Line 530 -     CHECK_GE(numchars, 0);
  Line 535 -   CHECK_EQ(0, uv_fs_close(loop, &close_req, fd, nullptr));
  Line 918 -     CHECK_GE(SYNC_REQ.result, 0);
  Line 1387 -   CHECK_GE(args.Length(), 2);
Processing file : D:\code\node\src\node_http_parser.cc
  Line 222 -     CHECK_LT(num_fields_, arraysize(fields_));
  Line 223 -     CHECK_EQ(num_fields_, num_values_ + 1);
  Line 238 -     CHECK_LT(num_values_, arraysize(values_));
  Line 239 -     CHECK_EQ(num_values_, num_fields_);
  Line 423 -     CHECK_EQ(parser->current_buffer_len_, 0);
  Line 424 -     CHECK_EQ(parser->current_buffer_data_, nullptr);
  Line 425 -     CHECK_EQ(Buffer::HasInstance(args[0]), true);
  Line 481 -     CHECK_EQ(env, parser->env());
  Line 494 -     CHECK_EQ(env, parser->env());
  Line 505 -     CHECK_NE(stream, nullptr);
  Line 529 -       CHECK_NE(stream, nullptr);
  Line 557 -       CHECK_GT(p_->refcount_, 0);
Processing file : D:\code\node\src\node_i18n.cc
  Line 132 -     CHECK_NE(conv, nullptr);
  Line 160 -     CHECK_GE(args.Length(), 1);
  Line 173 -     CHECK_GE(args.Length(), 2);
  Line 202 -     CHECK_GE(args.Length(), 3);  // Converter, Buffer, Flags
  Line 553 -     CHECK_GE(args.Length(), 1);
  Line 636 -     UIDNA_CHECK_BIDI |                // CheckBidi = true
  Line 637 -     UIDNA_CHECK_CONTEXTJ |            // CheckJoiners = true
  Line 707 -   CHECK_GE(args.Length(), 1);
  Line 727 -   CHECK_GE(args.Length(), 1);
Processing file : D:\code\node\src\node_mutex.h
  Line 116 -   CHECK_EQ(0, Traits::cond_init(&cond_));
  Line 141 -   CHECK_EQ(0, Traits::mutex_init(&mutex_));
Processing file : D:\code\node\src\node_os.cc
  Line 159 -   CHECK_EQ(array->Length(), 6 * NODE_PUSH_VAL_TO_ARRAY_MAX);
  Line 223 -   CHECK_EQ(array->Length(), 3);
Processing file : D:\code\node\src\node_serdes.cc
  Line 422 -   CHECK_GE(position, ctx->data_);
  Line 423 -   CHECK_LE(position + length, ctx->data_ + ctx->length_);
  Line 426 -   CHECK_EQ(ctx->data_ + offset, position);
Processing file : D:\code\node\src\node_stat_watcher.cc
  Line  87 -   CHECK_EQ(wrap->watcher_, handle);
  Line 107 -   CHECK_EQ(args.Length(), 3);
Processing file : D:\code\node\src\node_url.cc
  Line 788 -   CHECK_GT(parts, 0);
  Line 1961 -   CHECK_GE(args.Length(), 5);
  Line 1990 -   CHECK_GE(args.Length(), 1);
  Line 2008 -   CHECK_GE(args.Length(), 2);
  Line 2016 -   CHECK_GE(start, 0);
  Line 2043 -   CHECK_GE(args.Length(), 1);
  Line 2064 -   CHECK_GE(args.Length(), 1);
  Line 2130 -   CHECK_EQ(args.Length(), 1);
Processing file : D:\code\node\src\node_util.cc
  Line  42 -     CHECK_EQ(1, args.Length());                                               \
  Line  50 -   CHECK_EQ(1, args.Length());
  Line  93 -   CHECK_LT(index, arraysize(methods));
Processing file : D:\code\node\src\node_watchdog.cc
  Line  43 -   CHECK_EQ(0, rc);
  Line  46 -   CHECK_EQ(0, rc);
  Line  49 -   CHECK_EQ(0, rc);
  Line  52 -   CHECK_EQ(0, rc);
  Line  66 -   CHECK_EQ(0, rc);
  Line 185 -   CHECK_EQ(has_running_thread_, false);
  Line 191 -   CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &sigmask));
  Line 193 -   CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr));
  Line 244 -   CHECK_EQ(0, pthread_join(thread_, nullptr));
  Line 278 -   CHECK_NE(it, watchdogs_.end());
  Line 289 -   CHECK_EQ(0, uv_sem_init(&sem_, 0));
  Line 301 -   CHECK_EQ(has_running_thread_, false);
Processing file : D:\code\node\src\node_win32_etw_provider-inl.h
  Line 118 -   CHECK_EQ(status, ERROR_SUCCESS);
  Line 125 -   CHECK_EQ(status, ERROR_SUCCESS);
Processing file : D:\code\node\src\node_win32_etw_provider.cc
  Line 179 -     CHECK_EQ(0, uv_async_init(uv_default_loop(),
  Line 189 -       CHECK_EQ(status, ERROR_SUCCESS);
Processing file : D:\code\node\src\node_zlib.cc
  Line 100 -     CHECK_EQ(false, write_in_progress_ && "write in progress");
  Line 112 -     CHECK_LE(mode_, UNZIP);
  Line 143 -     CHECK_EQ(args.Length(), 7);
  Line 150 -     CHECK_EQ(false, ctx->write_in_progress_ && "write already in progress");
  Line 151 -     CHECK_EQ(false, ctx->pending_close_ && "close is pending");
  Line 155 -     CHECK_EQ(false, args[0]->IsUndefined() && "must provide flush value");
  Line 366 -     CHECK_EQ(status, 0);
  Line 395 -     CHECK_EQ(env->context(), env->isolate()->GetCurrentContext());
  Line 646 -     CHECK_GT(refs_, 0);
Processing file : D:\code\node\src\pipe_wrap.cc
  Line  55 -   CHECK_EQ(false, env->pipe_constructor_template().IsEmpty());
  Line  57 -   CHECK_EQ(false, constructor.IsEmpty());
  Line 129 -   CHECK_EQ(r, 0);  // How do we proxy this error up to javascript?
Processing file : D:\code\node\src\process_wrap.cc
  Line 121 -         CHECK_NE(stream, nullptr);
  Line 183 -         CHECK_NE(options.args[i], nullptr);
  Line 205 -         CHECK_NE(options.env[i], nullptr);
  Line 229 -       CHECK_EQ(wrap->process_.data, wrap);
  Line 261 -     CHECK_NE(wrap, nullptr);
  Line 262 -     CHECK_EQ(&wrap->process_, handle);
Processing file : D:\code\node\src\req-wrap-inl.h
  Line  31 -   CHECK_EQ(req_.data, this);  // Assert that someone has called Dispatched().
  Line  32 -   CHECK_EQ(false, persistent().IsEmpty());
Processing file : D:\code\node\src\signal_wrap.cc
  Line  84 -     CHECK_EQ(r, 0);
Processing file : D:\code\node\src\spawn_sync.cc
  Line  65 -   CHECK_EQ(buf->base, data_ + used());
  Line 131 -   CHECK_EQ(lifecycle_, kUninitialized);
  Line 145 -   CHECK_EQ(lifecycle_, kInitialized);
  Line 153 -       CHECK_NE(input_buffer_.base, nullptr);
  Line 220 -   CHECK_LT(lifecycle_, kClosing);
  Line 311 -   CHECK_NE(error, 0);
  Line 418 -   CHECK_EQ(lifecycle_, kHandlesClosed);
  Line 444 -   CHECK_EQ(lifecycle_, kUninitialized);
  Line 460 -   CHECK_EQ(lifecycle_, kUninitialized);
  Line 466 -   CHECK_EQ(uv_loop_init(uv_loop_), 0);
  Line 512 -   CHECK_GE(exit_status_, 0);
  Line 517 -   CHECK_LT(lifecycle_, kHandlesClosed);
  Line 539 -     CHECK_EQ(uv_loop_close(uv_loop_), 0);
  Line 545 -     CHECK_EQ(false, stdio_pipes_initialized_);
  Line 546 -     CHECK_EQ(false, kill_timer_initialized_);
  Line 554 -   CHECK_LT(lifecycle_, kHandlesClosed);
  Line 557 -     CHECK_NE(stdio_pipes_, nullptr);
  Line 558 -     CHECK_NE(uv_loop_, nullptr);
  Line 571 -   CHECK_LT(lifecycle_, kHandlesClosed);
  Line 574 -     CHECK_GT(timeout_, 0);
  Line 575 -     CHECK_NE(uv_loop_, nullptr);
  Line 705 -   CHECK_GE(lifecycle_, kInitialized);
  Line 706 -   CHECK_NE(stdio_pipes_, nullptr);
  Line 890 -   CHECK_LT(child_fd, stdio_count_);
  Line 891 -   CHECK_EQ(stdio_pipes_[child_fd], nullptr);
  Line 903 -   CHECK_LT(child_fd, stdio_count_);
  Line 904 -   CHECK_EQ(stdio_pipes_[child_fd], nullptr);
  Line 927 -   CHECK_LT(child_fd, stdio_count_);
  Line 928 -   CHECK_EQ(stdio_pipes_[child_fd], nullptr);
Processing file : D:\code\node\src\stream_base.cc
  Line  57 -   CHECK_NE(wrap, nullptr);
  Line  76 -   CHECK_EQ(req_wrap->persistent().IsEmpty(), false);
  Line 162 -   CHECK_NE(wrap, nullptr);
  Line 181 -       CHECK_LE(offset, storage_size);
  Line 248 -   CHECK_EQ(count, 1);
  Line 332 -     CHECK_EQ(count, 1);
  Line 355 -   CHECK_LE(data_size, storage_size);
  Line 370 -       CHECK_EQ(false, req_wrap->persistent().IsEmpty());
  Line 406 -   CHECK_EQ(req_wrap->persistent().IsEmpty(), false);
  Line 451 -   CHECK_NE(wrap, nullptr);
Processing file : D:\code\node\src\stream_base.h
  Line 233 -     CHECK_EQ(consumed_, false);
  Line 238 -     CHECK_EQ(consumed_, true);
Processing file : D:\code\node\src\stream_wrap.cc
  Line 170 -   CHECK_EQ(wrap->stream(), reinterpret_cast<uv_stream_t*>(handle));
  Line 227 -   CHECK_LE(static_cast<size_t>(nread), buf->len);
  Line 237 -     CHECK_EQ(pending, UV_UNKNOWN_HANDLE);
  Line 255 -   CHECK_EQ(wrap->persistent().IsEmpty(), false);
  Line 288 -   CHECK_GT(args.Length(), 0);
  Line 307 -   CHECK_NE(req_wrap, nullptr);
  Line 385 -   CHECK_NE(req_wrap, nullptr);
Processing file : D:\code\node\src\string_bytes.cc
  Line 324 -   CHECK_EQ(reinterpret_cast<uintptr_t>(aligned_dst) % sizeof(*dst), 0);
  Line 672 - #define CHECK_BUFLEN_IN_RANGE(len)                                    \
  Line 686 -   CHECK_NE(encoding, UCS2);
  Line 687 -   CHECK_BUFLEN_IN_RANGE(buflen);
  Line 743 -       CHECK_EQ(written, dlen);
  Line 756 -       CHECK_EQ(written, dlen);
  Line 774 -   CHECK_BUFLEN_IN_RANGE(buflen);
Processing file : D:\code\node\src\string_search.h
  Line 106 -     CHECK_GT(pattern_length, 0);
  Line 258 -       CHECK_LE(pos, max_n);
  Line 259 -       CHECK_LE(max_n - pos, SIZE_MAX / sizeof(Char));
  Line 262 -       CHECK_LE(pos, subject.length());
  Line 263 -       CHECK_LE(subject.length() - pos, SIZE_MAX / sizeof(Char));
  Line 323 -   CHECK_EQ(1, search->pattern_.length());
  Line 338 -   CHECK_GT(pattern.length(), 1);
  Line 345 -     CHECK_LE(i, n);
  Line 594 -       CHECK_LE(i, n);
Processing file : D:\code\node\src\tcp_wrap.cc
  Line  59 -   CHECK_EQ(env->tcp_constructor_template().IsEmpty(), false);
  Line  61 -   CHECK_EQ(constructor.IsEmpty(), false);
  Line 148 -   CHECK_EQ(r, 0);  // How do we proxy this error up to javascript?
Processing file : D:\code\node\src\timer_wrap.cc
  Line  92 -     CHECK_EQ(r, 0);
Processing file : D:\code\node\src\tls_wrap.cc
  Line  78 -   CHECK_NE(sc, nullptr);
  Line 206 -   CHECK_NE(stream, nullptr);
  Line 347 -   CHECK_NE(wrap->ssl_, nullptr);
  Line 404 -           CHECK_EQ(*msg, nullptr);
  Line 515 -     CHECK_GE(written, 0);
  Line 589 -   CHECK_EQ(send_handle, nullptr);
  Line 590 -   CHECK_NE(ssl_, nullptr);
  Line 858 -   CHECK_NE(wrap->ssl_, nullptr);
  Line 885 -   CHECK_NE(wrap->ssl_, nullptr);
  Line 923 -   CHECK_NE(sc, nullptr);
Processing file : D:\code\node\src\tty_wrap.cc
  Line  84 -   CHECK_GE(fd, 0);
  Line 106 -   CHECK_GE(fd, 0);
  Line 153 -   CHECK_GE(fd, 0);
Processing file : D:\code\node\src\udp_wrap.cc
  Line  98 -   CHECK_EQ(r, 0);  // can't fail anyway
  Line 182 -   CHECK_EQ(args.Length(), 3);
  Line 225 -     CHECK_EQ(args.Length(), 1);                                               \
  Line 246 -   CHECK_EQ(args.Length(), 2);
  Line 449 -   CHECK_EQ(env->udp_constructor_function().IsEmpty(), false);
Processing file : D:\code\node\src\util-inl.h
  Line 231 -   CHECK_EQ(false, object.IsEmpty());
  Line 232 -   CHECK_GT(object->InternalFieldCount(), 0);
  Line 242 -   CHECK_EQ(false, object.IsEmpty());
  Line 243 -   CHECK_GT(object->InternalFieldCount(), 0);
  Line 249 -   CHECK_EQ(nbytes % 2, 0);
  Line 273 -   CHECK_EQ(nbytes % 4, 0);
  Line 297 -   CHECK_EQ(nbytes % 8, 0);
  Line 347 -     CHECK_EQ(b, ret / a);
  Line 396 -   if (n > 0) CHECK_NE(ret, nullptr);
  Line 403 -   if (n > 0) CHECK_NE(ret, nullptr);
  Line 410 -   if (n > 0) CHECK_NE(ret, nullptr);
Processing file : D:\code\node\src\util.h
  Line 127 - #define CHECK_EQ(a, b) CHECK((a) == (b))
  Line 128 - #define CHECK_GE(a, b) CHECK((a) >= (b))
  Line 129 - #define CHECK_GT(a, b) CHECK((a) > (b))
  Line 130 - #define CHECK_LE(a, b) CHECK((a) <= (b))
  Line 131 - #define CHECK_LT(a, b) CHECK((a) < (b))
  Line 132 - #define CHECK_NE(a, b) CHECK((a) != (b))
  Line 295 -     CHECK_LT(index, length());
  Line 300 -     CHECK_LT(index, length());
  Line 335 -     CHECK_LE(length, capacity());
  Line 341 -     CHECK_LE(length + 1, capacity());
  Line 429 -     CHECK_NE(name##_data, nullptr);
Processing file : D:\code\node\src\tracing\agent.cc
  Line  21 -   CHECK_EQ(err, 0);
  Line  46 -   CHECK_EQ(err, 0);
Processing file : D:\code\node\src\tracing\node_trace_buffer.cc
  Line  98 -   CHECK_EQ(err, 0);
  Line 102 -   CHECK_EQ(err, 0);
Processing file : D:\code\node\src\tracing\node_trace_writer.cc
  Line  15 -   CHECK_EQ(err, 0);
  Line  19 -   CHECK_EQ(err, 0);
  Line  47 -     CHECK_EQ(err, 0);
  Line  64 -   CHECK_NE(fd_, -1);
  Line 126 -   CHECK_EQ(err, 0);
  Line 153 -   CHECK_EQ(err, 0);
  Line 158 -   CHECK_GE(write_req->req.result, 0);
  Line 164 -     CHECK_EQ(write_req, writer->write_req_queue_.front());
Wrong Audit:
Processing file : D:\code\node\src\base-object-inl.h
  Line  39 -   CHECK_EQ(false, handle.IsEmpty());
  Line  80 -   CHECK_GT(handle->InternalFieldCount(), 0);
Processing file : D:\code\node\src\env-inl.h
  Line 130 -   CHECK_GE(async_id, 0);
  Line 131 -   CHECK_GE(trigger_id, 0);
  Line 452 -   CHECK_NE(heap_statistics_buffer_, nullptr);
  Line 457 -   CHECK_EQ(heap_statistics_buffer_, nullptr);  // Should be set only once.
  Line 462 -   CHECK_NE(heap_space_statistics_buffer_, nullptr);
  Line 467 -   CHECK_EQ(heap_space_statistics_buffer_, nullptr);  // Should be set only once.
  Line 477 -   CHECK_EQ(http_parser_buffer_, nullptr);  // Should be set only once.
  Line 486 -   CHECK_EQ(fs_stats_field_array_, nullptr);  // Should be set only once.
Processing file : D:\code\node\src\node_crypto.h
  Line  81 -   CHECK_CERT_REVOKED = 0,
  Line  82 -   CHECK_OK = 1
  Line 196 -     CHECK_NE(ssl_, nullptr);
  Line 721 -     CHECK_NE(group_, nullptr);
Processing file : D:\code\node\src\node_crypto_bio.h
  Line 105 -     CHECK_NE(bio->ptr, nullptr);
Processing file : D:\code\node\src\node_crypto_clienthello-inl.h
  Line  52 -   CHECK_NE(onhello_cb, nullptr);
Processing file : D:\code\node\src\node_mutex.h
  Line 116 -   CHECK_EQ(0, Traits::cond_init(&cond_));
  Line 141 -   CHECK_EQ(0, Traits::mutex_init(&mutex_));
Processing file : D:\code\node\src\node_win32_etw_provider-inl.h
  Line 118 -   CHECK_EQ(status, ERROR_SUCCESS);
  Line 125 -   CHECK_EQ(status, ERROR_SUCCESS);
Processing file : D:\code\node\src\req-wrap-inl.h
  Line  31 -   CHECK_EQ(req_.data, this);  // Assert that someone has called Dispatched().
  Line  32 -   CHECK_EQ(false, persistent().IsEmpty());
Processing file : D:\code\node\src\stream_base.h
  Line 233 -     CHECK_EQ(consumed_, false);
  Line 238 -     CHECK_EQ(consumed_, true);
Processing file : D:\code\node\src\string_search.h
  Line 106 -     CHECK_GT(pattern_length, 0);
  Line 258 -       CHECK_LE(pos, max_n);
  Line 259 -       CHECK_LE(max_n - pos, SIZE_MAX / sizeof(Char));
  Line 262 -       CHECK_LE(pos, subject.length());
  Line 263 -       CHECK_LE(subject.length() - pos, SIZE_MAX / sizeof(Char));
  Line 323 -   CHECK_EQ(1, search->pattern_.length());
  Line 338 -   CHECK_GT(pattern.length(), 1);
  Line 345 -     CHECK_LE(i, n);
  Line 594 -       CHECK_LE(i, n);
Processing file : D:\code\node\src\util-inl.h
  Line 231 -   CHECK_EQ(false, object.IsEmpty());
  Line 232 -   CHECK_GT(object->InternalFieldCount(), 0);
  Line 242 -   CHECK_EQ(false, object.IsEmpty());
  Line 243 -   CHECK_GT(object->InternalFieldCount(), 0);
  Line 249 -   CHECK_EQ(nbytes % 2, 0);
  Line 273 -   CHECK_EQ(nbytes % 4, 0);
  Line 297 -   CHECK_EQ(nbytes % 8, 0);
  Line 347 -     CHECK_EQ(b, ret / a);
  Line 396 -   if (n > 0) CHECK_NE(ret, nullptr);
  Line 403 -   if (n > 0) CHECK_NE(ret, nullptr);
  Line 410 -   if (n > 0) CHECK_NE(ret, nullptr);
Processing file : D:\code\node\src\util.h
  Line 127 - #define CHECK_EQ(a, b) CHECK((a) == (b))
  Line 128 - #define CHECK_GE(a, b) CHECK((a) >= (b))
  Line 129 - #define CHECK_GT(a, b) CHECK((a) > (b))
  Line 130 - #define CHECK_LE(a, b) CHECK((a) <= (b))
  Line 131 - #define CHECK_LT(a, b) CHECK((a) < (b))
  Line 132 - #define CHECK_NE(a, b) CHECK((a) != (b))
  Line 295 -     CHECK_LT(index, length());
  Line 300 -     CHECK_LT(index, length());
  Line 335 -     CHECK_LE(length, capacity());
  Line 341 -     CHECK_LE(length + 1, capacity());
  Line 429 -     CHECK_NE(name##_data, nullptr);

@gibfahn
Copy link
Member

gibfahn commented Aug 12, 2017

Aside: IMO, CHECK_LE, CHECK_NE, etc. don't really add much because we don't print out LHS and RHS values like V8 does, we just turn it into LHS < RHS, LHS != RHS, etc.

Or maybe we could print out LHS and RHS values like V8 does (if it's helpful).

@bnoordhuis
Copy link
Member Author

bnoordhuis commented Aug 13, 2017

The reason I ultimately never added that was because it needs a lot of supporting machinery for turning values into text. You can't use iostreams because we have asserts in places where it's unsafe to use them, like in signal handlers.

edit: I don't want to imply it's impossible, I just didn't think it was worth the effort.

@refack
Copy link
Contributor

refack commented Aug 13, 2017

AFAICT id does print LHS & RHS just not tokenized

node/src/util.h

Lines 118 to 132 in b646a3d

#define CHECK(expr) \
do { \
if (UNLIKELY(!(expr))) { \
static const char* const args[] = { __FILE__, STRINGIFY(__LINE__), \
#expr, PRETTY_FUNCTION_NAME }; \
node::Assert(&args); \
} \
} while (0)
#define CHECK_EQ(a, b) CHECK((a) == (b))
#define CHECK_GE(a, b) CHECK((a) >= (b))
#define CHECK_GT(a, b) CHECK((a) > (b))
#define CHECK_LE(a, b) CHECK((a) <= (b))
#define CHECK_LT(a, b) CHECK((a) < (b))
#define CHECK_NE(a, b) CHECK((a) != (b))

i.e. CHECK_GE(4, 5)
will print something something 4 >= 5 somethings else

@bnoordhuis
Copy link
Member Author

@refack The idea is to print the actual values; e.g., CHECK_EQ(x, y) would print 4 != 5 instead of x != y.

@bnoordhuis
Copy link
Member Author

@jasnell jasnell added the http2 Issues or PRs related to the http2 subsystem. label Aug 23, 2017
@jasnell
Copy link
Member

jasnell commented Aug 23, 2017

btw, thanks @bnoordhuis ... you just crossed an item off my todo list :-)

jasnell pushed a commit that referenced this pull request Aug 23, 2017
PR-URL: #14663
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
@jasnell
Copy link
Member

jasnell commented Aug 23, 2017

Landed in 01160dd

@jasnell jasnell closed this Aug 23, 2017
addaleax pushed a commit to addaleax/ayo that referenced this pull request Aug 25, 2017
PR-URL: nodejs/node#14663
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Aug 28, 2017
PR-URL: nodejs/node#14663
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
PR-URL: #14663
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
PR-URL: #14663
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.