diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/StringLiteral.java b/src/de/dhbwstuttgart/syntaxtree/statement/StringLiteral.java index 96d0ef75..25b1e782 100755 --- a/src/de/dhbwstuttgart/syntaxtree/statement/StringLiteral.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/StringLiteral.java @@ -110,7 +110,9 @@ public class StringLiteral extends Literal public InstructionList genByteCode(ClassGen cg) { InstructionFactory _factory = new InstructionFactory(cg, cg.getConstantPool()); InstructionList il = new InstructionList(); - + + + il.append(_factory.ASTORE_1, _factory.createNew(string)); return il; diff --git a/test/bytecode/StringLitTest.jav b/test/bytecode/StringLitTest.jav index d221e988..b8596750 100644 --- a/test/bytecode/StringLitTest.jav +++ b/test/bytecode/StringLitTest.jav @@ -1,7 +1,7 @@ class StringLitTest{ -void method() { s = ""; } +void method() { s; s = ""; } } \ No newline at end of file