diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java b/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java index b2f69b33..a71592ed 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Assign.java @@ -179,8 +179,8 @@ public class Assign extends Expr //Bytecode: bipush 20 // istore_1 InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool()); - InstructionList il = this.expr2.genByteCode(cg);//expr2 rechte expr - il.append(_factory.createConstant(expr2.toString())); + InstructionList il = expr2.genByteCode(cg);//expr2 rechte expr + il.append(_factory.createConstant(expr2)); il.append(_factory.ISTORE_1); return il; } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/Return.java b/src/de/dhbwstuttgart/syntaxtree/statement/Return.java index a4b6dfbc..ad3907e0 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/Return.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/Return.java @@ -138,7 +138,7 @@ public class Return extends Statement InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool()); - //Stimmt das VOID hier eigentlich? + //Stimmt das VOID hier eigentlich? --> Wie wäre es mit getReturnType o.ä.? + evtl. von Type zu bcelType casten? il.append(_factory.createReturn(org.apache.bcel.generic.Type.VOID)); diff --git a/test/bytecode/StringLitTest.jav b/test/bytecode/StringLitTest.jav index 6397f8c7..d221e988 100644 --- a/test/bytecode/StringLitTest.jav +++ b/test/bytecode/StringLitTest.jav @@ -1,7 +1,7 @@ class StringLitTest{ -Object method() { s = ""; } +void method() { s = ""; } } \ No newline at end of file