aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release.yml6
-rw-r--r--src/stdlib/lists.h5
2 files changed, 6 insertions, 5 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 234d0685..d153774f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -23,7 +23,7 @@ jobs:
- name: Build
run: |
make clean
- make
+ make -j
- name: Package
run: |
@@ -58,7 +58,7 @@ jobs:
- name: Build
run: |
make clean
- make
+ make -j
- name: Package
run: |
@@ -87,7 +87,7 @@ jobs:
- name: Build
run: |
make clean
- make
+ make -j
- name: Package
run: |
diff --git a/src/stdlib/lists.h b/src/stdlib/lists.h
index 457fed52..6a0a1d43 100644
--- a/src/stdlib/lists.h
+++ b/src/stdlib/lists.h
@@ -61,7 +61,8 @@ extern char _EMPTY_LIST_SENTINEL;
t items[] = {__VA_ARGS__}; \
(List_t){.length = sizeof(items) / sizeof(items[0]), \
.stride = (int64_t)&items[1] - (int64_t)&items[0], \
- .data = memcpy(GC_MALLOC(sizeof(items)), items, sizeof(items)), \
+ .data = sizeof(items) == 0 ? &_EMPTY_LIST_SENTINEL \
+ : memcpy(GC_MALLOC(sizeof(items)), items, sizeof(items)), \
.atomic = 0, \
.data_refcount = 0}; \
})
@@ -70,7 +71,7 @@ extern char _EMPTY_LIST_SENTINEL;
t items[N] = {__VA_ARGS__}; \
(List_t){.length = N, \
.stride = (int64_t)&items[1] - (int64_t)&items[0], \
- .data = memcpy(GC_MALLOC(sizeof(items)), items, sizeof(items)), \
+ .data = N == 0 ? &_EMPTY_LIST_SENTINEL : memcpy(GC_MALLOC(sizeof(items)), items, sizeof(items)), \
.atomic = 0, \
.data_refcount = 0}; \
})