1
0
mirror of https://github.com/janet-lang/janet synced 2025-09-02 10:58:03 +00:00

Merge pull request #800 from marler8997/fixUbInGC

add NULL check in gc.c to avoid UB
This commit is contained in:
Calvin Rose
2021-09-14 16:04:12 -05:00
committed by GitHub

View File

@@ -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);