From 08aa642fe56a167c896759235b335d76cb291d3c Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 31 Aug 2021 15:11:17 +0300 Subject: [PATCH] C: prevent from casting to native function type --- .../org/teavm/backend/c/generate/CodeGenerationVisitor.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/main/java/org/teavm/backend/c/generate/CodeGenerationVisitor.java b/core/src/main/java/org/teavm/backend/c/generate/CodeGenerationVisitor.java index d5cd36aa1..077900ffe 100644 --- a/core/src/main/java/org/teavm/backend/c/generate/CodeGenerationVisitor.java +++ b/core/src/main/java/org/teavm/backend/c/generate/CodeGenerationVisitor.java @@ -1058,8 +1058,7 @@ public class CodeGenerationVisitor implements ExprVisitor, StatementVisitor { public void visit(CastExpr expr) { if (expr.getTarget() instanceof ValueType.Object) { String className = ((ValueType.Object) expr.getTarget()).getClassName(); - if (context.getCharacteristics().isStructure(className) - || className.equals(Address.class.getName())) { + if (!context.getCharacteristics().isManaged(className)) { expr.getValue().acceptVisitor(this); return; }