mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 19:19:53 +00:00
add NULL check in gc.c to avoid UB
After the UB was fixed in value.c, I tried running the build again and encoutered another instance of UB in gc.c. With this fixed I can now build janet with ubsan enabled, meaning there's no more UB encountered in janet_boot during the build.
This commit is contained in:
parent
b799223ebc
commit
e381622a9a
@ -123,6 +123,8 @@ static void janet_mark_abstract(void *adata) {
|
||||
|
||||
/* Mark a bunch of items in memory */
|
||||
static void janet_mark_many(const Janet *values, int32_t n) {
|
||||
if (values == NULL)
|
||||
return;
|
||||
const Janet *end = values + n;
|
||||
while (values < end) {
|
||||
janet_mark(*values);
|
||||
|
Loading…
Reference in New Issue
Block a user