From bb4315e48656a7a02c30e41e35e0f69919774364 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 24 Mar 2021 16:09:01 +0300 Subject: [PATCH] C: fix missing files when casting to arrays --- .../java/org/teavm/backend/c/generate/ClassGenerator.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 bd1c5a768..5bdc84c7d 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 @@ -63,6 +63,7 @@ import org.teavm.model.classes.TagRegistry; import org.teavm.model.classes.VirtualTable; import org.teavm.model.classes.VirtualTableEntry; import org.teavm.model.instructions.AbstractInstructionVisitor; +import org.teavm.model.instructions.CastInstruction; import org.teavm.model.instructions.ClassConstantInstruction; import org.teavm.model.instructions.ConstructArrayInstruction; import org.teavm.model.instructions.ConstructInstruction; @@ -190,6 +191,11 @@ public class ClassGenerator { addType(insn.getType()); } + @Override + public void visit(CastInstruction insn) { + addType(insn.getTargetType()); + } + @Override public void visit(ConstructMultiArrayInstruction insn) { ValueType type = insn.getItemType();