shithub: mc

Download patch

ref: 5a1d952aa7f08885c8de6afbbfa948c675f79f89
parent: c39b0cd430515c79ce14792b6f815cb7dd9f6e90
author: Ori Bernstein <[email protected]>
date: Sun Dec 13 17:26:00 EST 2015

Fix a couple of segfaults.

	We should actually use valid values when generating errors.

--- a/mi/match.c
+++ b/mi/match.c
@@ -565,6 +565,10 @@
 		tail = NULL;
 		ntail = 0;
 
+		if (!memb) {
+			memb = mkexpr(ty->sdecls[i]->loc, Ogap, NULL);
+			memb->expr.type = mty;
+		}
 		for (j = 0; j < nlast; j++) {
 			/* add a _ capture if we don't specify the value */
 			if (!memb) {
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -318,7 +318,7 @@
 int mergetype(Type *old, Type *new)
 {
 	if (!new) {
-		lfatal(new->loc, "double prototyping of %s", tystr(new));
+		lfatal(old->loc, "double prototyping of %s", tystr(new));
 	}
 	else if (old->vis == Visexport && new->vis != Visexport) {
 		if (!old->sub && new->sub) {