diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc
index e5ea0ca2..9c4726a6 100644
--- a/src/abg-ctf-reader.cc
+++ b/src/abg-ctf-reader.cc
@@ -350,7 +350,7 @@ process_ctf_sou_members(read_context *ctxt,
   while ((member_size = ctf_member_next(ctf_dictionary, ctf_type,
                                         &member_next, &member_name,
                                         &member_ctf_type,
-                                        CTF_MN_RECURSE)) >= 0)
+                                        0 /* flags */)) >= 0)
     {
       ctf_membinfo_t membinfo;
 
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am
index a7eb7ff0..243be3ba 100644
--- a/tests/data/Makefile.am
+++ b/tests/data/Makefile.am
@@ -666,6 +666,9 @@ test-read-ctf/test-list-struct.abi	\
 test-read-ctf/test-callback2.c		\
 test-read-ctf/test-callback2.o		\
 test-read-ctf/test-callback2.abi	\
+test-read-ctf/test-anonymous-fields.c	\
+test-read-ctf/test-anonymous-fields.o	\
+test-read-ctf/test-anonymous-fields.o.abi	\
 \
 test-annotate/test0.abi			\
 test-annotate/test1.abi			\
diff --git a/tests/data/test-read-ctf/test-anonymous-fields.c b/tests/data/test-read-ctf/test-anonymous-fields.c
new file mode 100644
index 00000000..25c21047
--- /dev/null
+++ b/tests/data/test-read-ctf/test-anonymous-fields.c
@@ -0,0 +1,18 @@
+/*
+ * test single var-decl in anonymous struct/union
+ * gcc -gctf -c tests/data/test-read- ctf/test-anonymous-fields.c \
+ *    -o tests/data/test-read-ctf/test-anonymous-fields.o
+*/
+struct uprobe_task {
+ union {
+  struct {
+   unsigned long vaddr;
+  };
+
+  struct {
+   int dup_xol_work;
+  };
+ };
+};
+
+struct uprobe_task t;
diff --git a/tests/data/test-read-ctf/test-anonymous-fields.o b/tests/data/test-read-ctf/test-anonymous-fields.o
new file mode 100644
index 0000000000000000000000000000000000000000..452a8122c5cf4fa8fb81772bdfd824dfa92954ce
GIT binary patch
diff --git a/tests/data/test-read-ctf/test-anonymous-fields.o.abi b/tests/data/test-read-ctf/test-anonymous-fields.o.abi
new file mode 100644
index 00000000..0419c29c
--- /dev/null
+++ b/tests/data/test-read-ctf/test-anonymous-fields.o.abi
@@ -0,0 +1,33 @@
+<abi-corpus version='2.1' path='data/test-read-ctf/test-anonymous-fields.o'>
+  <elf-variable-symbols>
+    <elf-symbol name='t' size='8' type='object-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
+  </elf-variable-symbols>
+  <abi-instr address-size='64' language='LANG_C'>
+    <class-decl name='' size-in-bits='64' alignment-in-bits='64' is-struct='yes' is-anonymous='yes' visibility='default' id='type-id-1'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='vaddr' type-id='type-id-2' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='' size-in-bits='32' alignment-in-bits='32' is-struct='yes' is-anonymous='yes' visibility='default' id='type-id-3'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='dup_xol_work' type-id='type-id-4' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <class-decl name='uprobe_task' size-in-bits='64' alignment-in-bits='64' is-struct='yes' visibility='default' id='type-id-5'>
+      <data-member access='public' layout-offset-in-bits='0'>
+        <var-decl name='' type-id='type-id-6' visibility='default'/>
+      </data-member>
+    </class-decl>
+    <type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-4'/>
+    <union-decl name='' size-in-bits='64' is-anonymous='yes' visibility='default' id='type-id-6'>
+      <data-member access='public'>
+        <var-decl name='' type-id='type-id-1' visibility='default'/>
+      </data-member>
+      <data-member access='public'>
+        <var-decl name='' type-id='type-id-3' visibility='default'/>
+      </data-member>
+    </union-decl>
+    <type-decl name='unsigned long int' size-in-bits='64' alignment-in-bits='64' id='type-id-2'/>
+    <var-decl name='t' type-id='type-id-5' mangled-name='t' visibility='default'/>
+  </abi-instr>
+</abi-corpus>
diff --git a/tests/test-read-ctf.cc b/tests/test-read-ctf.cc
index e7a87186..94e65197 100644
--- a/tests/test-read-ctf.cc
+++ b/tests/test-read-ctf.cc
@@ -212,6 +212,14 @@ static InOutSpec in_out_specs[] =
     "data/test-read-ctf/test-dynamic-array.o.abi",
     "output/test-read-ctf/test-dynamic-array.o.abi"
   },
+  {
+    "data/test-read-ctf/test-anonymous-fields.o",
+    "",
+    "",
+    SEQUENCE_TYPE_ID_STYLE,
+    "data/test-read-ctf/test-anonymous-fields.o.abi",
+    "output/test-read-ctf/test-anonymous-fields.o.abi"
+  },
   {
     "data/test-read-common/PR27700/test-PR27700.o",
     "",
