From cf4c2b70323cad4d3d50cc25ce16c5140e1dfb50 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 28 Apr 1999 16:27:21 +0000 Subject: [PATCH] instr.dumpExpression printType() git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@695 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/flow/InstructionBlock.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/jode/jode/flow/InstructionBlock.java b/jode/jode/flow/InstructionBlock.java index 762ee68..db7b8dd 100644 --- a/jode/jode/flow/InstructionBlock.java +++ b/jode/jode/flow/InstructionBlock.java @@ -93,10 +93,9 @@ public class InstructionBlock extends InstructionContainer { * @return true if this block should be sorrounded by braces. */ public boolean needsBraces() { - return declare != null && !declare.isEmpty(); + return isDeclaration || (declare != null && !declare.isEmpty()); } - /** * Check if this is an local store instruction to a not yet declared * variable. In that case mark this as declaration and return the @@ -134,14 +133,15 @@ public class InstructionBlock extends InstructionContainer { public void dumpInstruction(TabbedPrintWriter writer) throws java.io.IOException { - if (isDeclaration) { + if (instr.getType() != Type.tVoid) + writer.print("PUSH "); + else if (isDeclaration) { LocalInfo local = ((LocalStoreOperator) instr.getOperator()) .getLocalInfo(); - writer.println(local.getType().getHint() + " " + instr + ";"); - } else { - if (instr.getType() != Type.tVoid) - writer.print("PUSH "); - writer.println(instr.toString()+";"); - } + writer.printType(local.getType().getHint()); + writer.print(" "); + } + instr.dumpExpression(writer); + writer.println(";"); } }