~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH harec v2] Fix segfault on not enough params for variadic function call

Details
Message ID
<20220604164356.3119952-1-mail@smlavine.com>
DKIM signature
pass
Download raw message
Patch: +1 -1
As shown by this minimal test case:

fn foo(a: int, v: int...) void = void;

export fn main() void = {
	//foo(0); // << okay
	foo(); // harec segfaults
};

Signed-off-by: Sebastian LaVine <mail@smlavine.com>
---
v1 -> v2:
- Check for !param->next instead of param->type->array.members
 src/check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/check.c b/src/check.c
index 558187f..e708520 100644
--- a/src/check.c
+++ b/src/check.c
@@ -1211,7 +1211,7 @@ check_expr_call(struct context *ctx,
		}
	}

	if (param && fntype->func.variadism == VARIADISM_HARE) {
	if (param && !param->next && fntype->func.variadism == VARIADISM_HARE) {
		// No variadic arguments, lower to empty slice
		arg = *next = xcalloc(1, sizeof(struct call_argument));
		arg->value = xcalloc(1, sizeof(struct expression));
-- 
2.36.1

[harec/patches] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CKHI2Z3BP7N4.3U9PBWI4R4B21@cirno2>
In-Reply-To
<20220604164356.3119952-1-mail@smlavine.com> (view parent)
DKIM signature
missing
Download raw message
harec/patches: FAILED in 52s

[Fix segfault on not enough params for variadic function call][0] v2 from [Sebastian LaVine][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/32753
[1]: mail@smlavine.com

✓ #774087 SUCCESS harec/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/774087
✗ #774088 FAILED  harec/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/774088
Details
Message ID
<CKHIKH3F40RA.MRXYLC5SFK2F@attila>
In-Reply-To
<20220604164356.3119952-1-mail@smlavine.com> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/harec
   521d771..5ae8866  master -> master
Reply to thread Export thread (mbox)