From a57b7d5077ade09840cf8d1cfe0c88ae877ec2b7 Mon Sep 17 00:00:00 2001 From: Karang Date: Thu, 1 Apr 2021 22:09:53 +0200 Subject: [PATCH] Fix anon bitfields --- src/datatypes/compiler-structures.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/datatypes/compiler-structures.js b/src/datatypes/compiler-structures.js index 76c9a3f..51afc6b 100644 --- a/src/datatypes/compiler-structures.js +++ b/src/datatypes/compiler-structures.js @@ -39,9 +39,13 @@ module.exports = { const subnames = [] for (const { name } of type[1]) { const trueName = compiler.getField(name) - subnames.push(trueName) - if (name === trueName) names.push(name) - else names.push(`${name}: ${trueName}`) + if (name === trueName) { + names.push(name) + subnames.push(name) + } else { + names.push(`${name}: ${trueName}`) + subnames.push(`${name}: ${trueName}`) + } } trueName = '{' + subnames.join(', ') + '}' sizeName = `anon${i}Size`