From 333ee95604ec4ce31d35b98b83c7c865cfcdb727 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 15 May 2020 18:05:50 +0300 Subject: [PATCH] C: in addition to deece78decc3302f42d250ce4f4e4942701005c1 Fix generation of heap dump metadata --- .../java/org/teavm/backend/c/generate/ClassGenerator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/teavm/backend/c/generate/ClassGenerator.java b/core/src/main/java/org/teavm/backend/c/generate/ClassGenerator.java index 1e73567eb..003801139 100644 --- a/core/src/main/java/org/teavm/backend/c/generate/ClassGenerator.java +++ b/core/src/main/java/org/teavm/backend/c/generate/ClassGenerator.java @@ -922,7 +922,7 @@ public class ClassGenerator { codeWriter.println("fieldDescriptors = (TeaVM_FieldDescriptors*) " + "&(struct { uint32_t count; TeaVM_FieldDescriptor data[" + fields.size() + "]; }) {").indent(); - generateHeapDumpFields(fields); + generateHeapDumpFields(codeWriter, fields); codeWriter.outdent().print("}"); if (initMethod) { codeWriter.println(";"); @@ -938,7 +938,7 @@ public class ClassGenerator { codeWriter.println("staticFieldDescriptors = (TeaVM_StaticFieldDescriptors*) " + "&(struct { uint32_t count; TeaVM_StaticFieldDescriptor data[" + staticFields.size() + "]; }) {").indent(); - generateHeapDumpFields(staticFields); + generateHeapDumpFields(codeWriter, staticFields); codeWriter.outdent().print("}"); if (initMethod) { codeWriter.println(";"); @@ -947,7 +947,7 @@ public class ClassGenerator { codeWriter.println().outdent().println("#endif"); } - private void generateHeapDumpFields(List fields) { + private void generateHeapDumpFields(CodeWriter codeWriter, List fields) { codeWriter.println(".count = " + fields.size() + ","); codeWriter.println(".data = {").indent(); for (int i = 0; i < fields.size(); ++i) {