Fix assertion failure on too many parameters in a nested function (#3663)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
A call passing more than 4095 arguments at the start of a nested function body aborted jq after reporting the compile errors, with "Assertion failed: (nemb > 0 && sz > 0), function jv_mem_calloc" and exit status 134. Stop compiling a function before its bytecode is allocated when it has compile errors, since the bytecode is only generated and used when compilation succeeds. jq now prints the same compile errors followed by "jq: 2 compile errors" and exits with status 3, as it does for other compile errors, instead of crashing.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+21 added−1 removed
- tests:+14 added−0 removed
- other:+7 added−1 removed