Skip to content

zlib: alter wrong argument number error message

The ZCtx::Init function presents a standard CHECK to handle the argument number. The correct number of arguments as of now is 7.

The CHECK usage follows the standard usage in the node C++ code, yet this is the only instance where the error message is long enough so as to be split in two lines. The macro CHECK displays this error message incorrectly.

The fix revolves around a copy of the macro, injected in the point of code where the previous CHECK was residing; it formats the message in the same way the macro would have and cleanly exits the execution.

Fixes: https://github.com/nodejs/node/issues/16987

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Notes:

  • Commit message guidelines followed, yet core-validate-commit fails due to absence of PR-URL and reviewer (might it be acceptable in opening the pull request?)
  • I was not able to create a test for the code correction. I'd like to ask for support in how to create a test case.

I remain at disposal for every problem that maight arise. Thanks!

Merge request reports

Loading