From 03645f7a8487aeb2ad6226841ef38a94bf773212 Mon Sep 17 00:00:00 2001 From: Bruder John Date: Wed, 8 May 2024 23:47:37 +0200 Subject: [PATCH] fixed bugs after update branch --- src/main/java/CompilerInput.txt | 8 ++++++++ src/main/java/bytecode/FieldCodeGen.java | 2 +- src/main/java/classFileOutput/Example.class | Bin 82 -> 100 bytes src/main/java/classFileOutput/Test.class | Bin 79 -> 97 bytes src/main/resources/Example.txt | 12 ------------ 5 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 src/main/resources/Example.txt diff --git a/src/main/java/CompilerInput.txt b/src/main/java/CompilerInput.txt index 106dace..0a31d5c 100644 --- a/src/main/java/CompilerInput.txt +++ b/src/main/java/CompilerInput.txt @@ -1,3 +1,11 @@ public class Example { + public int test; + +} + +public class Test { + + public char test; + } \ No newline at end of file diff --git a/src/main/java/bytecode/FieldCodeGen.java b/src/main/java/bytecode/FieldCodeGen.java index 8dd6a99..5e08941 100644 --- a/src/main/java/bytecode/FieldCodeGen.java +++ b/src/main/java/bytecode/FieldCodeGen.java @@ -9,6 +9,6 @@ public class FieldCodeGen { public void generateFieldCode(ClassWriter classWriter, FieldNode fieldNode) { Mapper mapper = new Mapper(); - FieldVisitor fieldVisitor = classWriter.visitField(mapper.mapAccesTypeToOpcode(fieldNode.accessTypeNode), fieldNode.name, "", null, null); + FieldVisitor fieldVisitor = classWriter.visitField(mapper.mapAccesTypeToOpcode(fieldNode.accessTypeNode), fieldNode.identifier.getName(), "", null, null); } } diff --git a/src/main/java/classFileOutput/Example.class b/src/main/java/classFileOutput/Example.class index e44ef841c1ac9c7a2dea4460be34708d0b01a613..7490cc13f94b6ef8362c61528e6ed8b919e01a52 100644 GIT binary patch delta 57 zcmWGa;X3ti*FFXY1``I(iCjh+j0`L#sl_FXKoLd;CI%KT&B(yczyW2kGOz(z3;;^l B2Oa`j0`L#sl_FXKoLd;CI%KT&B(yczyW2kGOz(z3;;<7 B2NeJS delta 39 qcmYfF=Q{Oo*FFXY1``JMiCp?(42%p+3@kuC1CYhYz{