[jboss-svn-commits] JBL Code SVN: r29462 - in labs/jbosstm/workspace/adinn/byteman/trunk: tests and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Sep 25 06:18:19 EDT 2009


Author: adinn
Date: 2009-09-25 06:18:19 -0400 (Fri, 25 Sep 2009)
New Revision: 29462

Modified:
   labs/jbosstm/workspace/adinn/byteman/trunk/src/org/jboss/byteman/rule/expression/ArithmeticExpression.java
   labs/jbosstm/workspace/adinn/byteman/trunk/tests/build.xml
Log:
corrected error in arithmetic compilation -- foxes BYTEMAN-39

Modified: labs/jbosstm/workspace/adinn/byteman/trunk/src/org/jboss/byteman/rule/expression/ArithmeticExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/byteman/trunk/src/org/jboss/byteman/rule/expression/ArithmeticExpression.java	2009-09-25 10:16:47 UTC (rev 29461)
+++ labs/jbosstm/workspace/adinn/byteman/trunk/src/org/jboss/byteman/rule/expression/ArithmeticExpression.java	2009-09-25 10:18:19 UTC (rev 29462)
@@ -283,8 +283,8 @@
         operand0.compile(mv, currentStackHeights, maxStackHeights);
         // do any required type conversion
         compileTypeConversion(type0, type, mv, currentStackHeights, maxStackHeights);
-        // compile lhs -- it adds 1 or 2 to the stack height
-        currentStackHeights.addStackCount((type0.getNBytes() > 4 ? 2 : 1));
+        // compile rhs -- it adds 1 or 2 to the stack height
+        operand1.compile(mv, currentStackHeights, maxStackHeights);
         // do any required type conversion
         compileTypeConversion(type1, type, mv, currentStackHeights, maxStackHeights);
 
@@ -419,7 +419,7 @@
 
         // check stack heights
         if (currentStackHeights.stackCount != currentStack + expectedStack) {
-            throw new CompileException("ArithmeticExpression.compile : invalid stack height " + currentStackHeights.stackCount + " expecting " + currentStack + expectedStack);
+            throw new CompileException("ArithmeticExpression.compile : invalid stack height " + currentStackHeights.stackCount + " expecting " + (currentStack + expectedStack));
         }
 
         // we needed room for 2 * expectedStack extra values on the stack -- make sure we got it

Modified: labs/jbosstm/workspace/adinn/byteman/trunk/tests/build.xml
===================================================================
--- labs/jbosstm/workspace/adinn/byteman/trunk/tests/build.xml	2009-09-25 10:16:47 UTC (rev 29461)
+++ labs/jbosstm/workspace/adinn/byteman/trunk/tests/build.xml	2009-09-25 10:18:19 UTC (rev 29462)
@@ -56,6 +56,7 @@
     <target name="compile" depends="init">
         <javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${javac.debug}">
             <classpath>
+                <pathelement location="${byteman.home}/${byteman.jar}"/>
                 <pathelement location="${junit.home}/${junit.jar}"/>
             </classpath>
         </javac>
@@ -321,6 +322,7 @@
                 <pathelement location="${junit.home}/${junit.jar}"/>
             </classpath>
             <jvmarg value="-javaagent:${byteman.home}/${byteman.jar}=script:${scripts.dir}/javaops/TestArithmetic.txt"/>
+            <jvmarg value="-Dorg.jboss.byteman.compileToBytecode"/>
             <test name="org.jboss.byteman.tests.javaops.TestArithmetic"/>
         </junit>
         <junit fork="true" showoutput="true">



More information about the jboss-svn-commits mailing list