You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2012/09/01 01:58:02 UTC

svn commit: r1379672 - /incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/arithmetic/IntegerDivideOperation.java

Author: prestonc
Date: Fri Aug 31 23:58:02 2012
New Revision: 1379672

URL: http://svn.apache.org/viewvc?rev=1379672&view=rev
Log:
Missing check for divide by zero.

Modified:
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/arithmetic/IntegerDivideOperation.java

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/arithmetic/IntegerDivideOperation.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/arithmetic/IntegerDivideOperation.java?rev=1379672&r1=1379671&r2=1379672&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/arithmetic/IntegerDivideOperation.java (original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/arithmetic/IntegerDivideOperation.java Fri Aug 31 23:58:02 2012
@@ -372,6 +372,9 @@ public class IntegerDivideOperation exte
     @Override
     public void operateIntegerInteger(LongPointable longp, LongPointable longp2, DataOutput dOut)
             throws SystemException, IOException {
+        if (longp.getLong() == 0) {
+            throw new SystemException(ErrorCode.FOAR0001);
+        }
         long value = longp.getLong();
         value /= longp2.getLong();
         dOut.write(ValueTag.XS_INTEGER_TAG);