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: remove unneeded ABORT after CHECK(0) #8593

Closed
wants to merge 1 commit into from

Conversation

yorkie
Copy link
Contributor

@yorkie yorkie commented Sep 17, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

src

Description of change

CHECK includes node::Abort(), so that's unneeded to call ABORT after
CHECK(0).

In src/util.h:

#define ABORT() node::Abort()
#define CHECK(expr)                                                           \
  do {                                                                        \
    if (UNLIKELY(!(expr))) {                                                  \
      static const char* const args[] = { __FILE__, STRINGIFY(__LINE__),      \
                                          #expr, PRETTY_FUNCTION_NAME };      \
      node::Assert(&args);                                                    \
    }                                                                         \
  } while (0)

And in src/node.cc:

NO_RETURN void Abort() {
  // ...
}
NO_RETURN void Assert(const char* const (*args)[4]) {
  // ...
  Abort();
}

Thus we could remove ABORT()s after CHECK(0) :)

CHECK includes node::Abort(), so that's unneeded to call ABORT after
CHECK.
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Sep 17, 2016
@mscdex mscdex added crypto Issues and PRs related to the crypto subsystem. fs Issues and PRs related to the fs subsystem / file system. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. labels Sep 17, 2016
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yorkie
Copy link
Contributor Author

yorkie commented Sep 19, 2016

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yorkie
Copy link
Contributor Author

yorkie commented Sep 21, 2016

Does this CI failure on arm-fanned is related?

@jasnell
Copy link
Member

jasnell commented Sep 21, 2016

@yorkie .. no, I do not believe so. The arm failures are something else and I believe the @nodejs/build team is actively working on getting those resolved.

jasnell pushed a commit that referenced this pull request Sep 22, 2016
CHECK includes node::Abort(), so that's unneeded to call ABORT after
CHECK.

PR-URL: #8593
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@jasnell
Copy link
Member

jasnell commented Sep 22, 2016

Landed in 9a6e253. Thank you @yorkie !

@jasnell jasnell closed this Sep 22, 2016
@yorkie yorkie deleted the src/clean-aborts branch September 23, 2016 01:16
jasnell pushed a commit that referenced this pull request Sep 29, 2016
CHECK includes node::Abort(), so that's unneeded to call ABORT after
CHECK.

PR-URL: #8593
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Oct 11, 2016
CHECK includes node::Abort(), so that's unneeded to call ABORT after
CHECK.

PR-URL: #8593
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[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++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. crypto Issues and PRs related to the crypto subsystem. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants