Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/5] Check anonstructs a few more times


The handling of one anonstruct can create more, e.g. in

	struct foo {
	        union {
	                struct {
	                        int a;
	                        long a;
	                } y1;
	                int y2;
	        } y;
	};

Be slightly less clever about how we handle anonstructs in order to
catch all the member types.
---
 myrglue.myr | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/myrglue.myr b/myrglue.myr
index 0a0a5be..cea5ed1 100644
--- a/myrglue.myr
+++ b/myrglue.myr
@@ -63,10 +63,11 @@ const emitmyrproto = {f, ctx
 		;;
 	;;
 
-
-	for (i, s) : iter.byenum(anonstructs)
+	var i = 0
+	while i < anonstructs.len
 		n = std.bfmt(buf[:], "_anon{}", i)
-		protostruct(ctx, f, n, s)
+		protostruct(ctx, f, n, anonstructs[i])
+		i++
 	;;
 
 	bio.put(f, ";;\n")
-- 
2.26.2


References:
[PATCH 0/5] mcbind patches, round 2"S. Gilles" <sgilles@xxxxxxx>