From 494d36eaabc1fefc01ea1c158abfe14f14e7769c Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 28 Apr 1999 11:00:52 +0000 Subject: [PATCH] getLValuePriority bugfix postFix means operator to end git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@681 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/expr/PrePostFixOperator.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/jode/jode/expr/PrePostFixOperator.java b/jode/jode/expr/PrePostFixOperator.java index 2c8ca43..43b8391 100644 --- a/jode/jode/expr/PrePostFixOperator.java +++ b/jode/jode/expr/PrePostFixOperator.java @@ -58,8 +58,11 @@ public class PrePostFixOperator extends Operator { * Sets the return type of this operator. */ public void setType(Type type) { - store.setLValueType(type); - super.setType(store.getLValueType()); + if (!isVoid()) { + store.setLValueType(type); + super.setType(store.getLValueType()); + } else + super.setType(type); } public void setOperandType(Type[] inputTypes) { @@ -71,18 +74,18 @@ public class PrePostFixOperator extends Operator { throws java.io.IOException { boolean needBrace = false; int priority = 700; - if (postfix) { + if (!postfix) { writer.print(getOperatorString()); priority = 800; } - if (store.getPriority() < priority) { + if (store.getLValuePriority() < priority) { needBrace = true; writer.print("("); } store.dumpLValue(writer, operands); if (needBrace) writer.print(")"); - if (!postfix) + if (postfix) writer.print(getOperatorString()); } }