You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by il...@apache.org on 2003/05/27 23:32:00 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/templates ElemExsltFunction.java

ilene       2003/05/27 14:32:00

  Modified:    java/src/org/apache/xpath VariableStack.java
               java/src/org/apache/xalan/templates ElemExsltFunction.java
  Log:
  Patch from Christine Li (jycli@ca.ibm.com) for bugzilla #18926.
  
  Variables weren't being cleared from stack between calls to func:function.
  
  Revision  Changes    Path
  1.44      +7 -3      xml-xalan/java/src/org/apache/xpath/VariableStack.java
  
  Index: VariableStack.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/VariableStack.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- VariableStack.java	30 Jan 2003 18:46:22 -0000	1.43
  +++ VariableStack.java	27 May 2003 21:32:00 -0000	1.44
  @@ -72,6 +72,10 @@
    */
   public class VariableStack implements Cloneable
   {
  +  /**
  +   * limitation for 1K
  +   */
  +  public static final int CLEARLIMITATION= 1024;
   
     /**
      * Constructor for a variable stack.
  @@ -216,7 +220,7 @@
   
       if (_frameTop >= _stackFrames.length)
       {
  -      XObject newsf[] = new XObject[_stackFrames.length + (1024 * 4) + size];
  +      XObject newsf[] = new XObject[_stackFrames.length + XPathContext.RECURSIONLIMIT + size];
   
         System.arraycopy(_stackFrames, 0, newsf, 0, _stackFrames.length);
   
  @@ -225,7 +229,7 @@
   
       if (_linksTop + 1 >= _links.length)
       {
  -      int newlinks[] = new int[_links.length + (1024 * 2)];
  +      int newlinks[] = new int[_links.length + (CLEARLIMITATION * 2)];
   
         System.arraycopy(_links, 0, newlinks, 0, _links.length);
   
  @@ -395,7 +399,7 @@
     }
   
     /** NEEDSDOC Field m_nulls          */
  -  private static XObject[] m_nulls = new XObject[1024];
  +  private static XObject[] m_nulls = new XObject[CLEARLIMITATION];
   
     /**
      * Use this to clear the variables in a section of the stack.  This is
  
  
  
  1.6       +3 -1      xml-xalan/java/src/org/apache/xalan/templates/ElemExsltFunction.java
  
  Index: ElemExsltFunction.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemExsltFunction.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ElemExsltFunction.java	30 Jan 2003 18:45:50 -0000	1.5
  +++ ElemExsltFunction.java	27 May 2003 21:32:00 -0000	1.6
  @@ -123,7 +123,9 @@
       int oldStackFrame = vars.getStackFrame();
       vars.setStackFrame(m_callerFrameSize + oldStackFrame);
       
  -    // Set parameters.
  +    // Set parameters,
  +    // have to clear the section of the stack frame that has params.
  +    vars.clearLocalSlots(vars.getStackFrame(), VariableStack.CLEARLIMITATION);
       NodeList children = this.getChildNodes();
       int numparams =0;
       for (int i = 0; i < args.length; i ++)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org