Build errors under Ubuntu 22.04
lread opened this issue · comments
While looking at #1087, I noticed the following while running script/build -Werror --fast
against planck master on Ubuntu 22.04:
In function 'maybe_load_user_file',
inlined from 'maybe_load_user_file' at /planck/planck-c/engine.c:414:6:
/planck/planck-c/engine.c:418:9: error: 'JSObjectCallAsFunction' reading 8 bytes from a region of size 0 [-Werror=stringop-overread]
418 | JSObjectCallAsFunction(ctx, get_function("planck.repl", "maybe-load-user-file"), JSContextGetGlobalObject(ctx),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
419 | 0, arguments, &ex);
| ~~~~~~~~~~~~~~~~~~
/planck/planck-c/engine.c: In function 'maybe_load_user_file':
/planck/planck-c/engine.c:418:9: note: referencing argument 5 of type 'const struct OpaqueJSValue * const*'
And this note that arguments
should be NULL when argumentCount is 0:
arguments
A JSValueRef array of arguments to pass to the function. Pass NULL ifargumentCount
is 0.
And things do pass after correcting this on Ubuntu 22, but still seg fault on Ubuntu 20.
Originally posted by @lread in #1087 (comment)
Since Ubuntu 22.04 has been officially released, probably a good idea to address.
I'll follow up with a PR.