Program: 75812
Project: 75812
Buggy source:
/** 
 * Set the input variables for the channel of the port.
 * @param port An input port of this actor.
 * @param channel A channel of the input port.
 * @exception IllegalActionException If the port is not contained bythis actor, or if the port is not an input port, or if the value variable cannot take the token read from the channel.
 */
protected void _setInputVariables(TypedIOPort port,int channel) throws IllegalActionException {
  if (port.getContainer() != this) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  if (!port.isInput()) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  if (_debugging) {
    _debug(this.getFullName(),"String_Node_Str",port.getName());
  }
  int width=port.getWidth();
  Variable[][] pVars=(Variable[][])_inputVariableMap.get(port);
  if (pVars == null) {
    throw new InternalErrorException(getName() + "String_Node_Str" + "String_Node_Str"+ port.getName()+ "String_Node_Str");
  }
  Token tok;
  boolean t;
  while (t=port.hasToken(channel)) {
    if (_debugging) {
      _debug(port.getName(),"String_Node_Str" + t);
    }
    if (_debug_info) {
      System.out.println("String_Node_Str" + port.getName() + "String_Node_Str"+ t);
    }
    tok=t ? BooleanToken.TRUE : BooleanToken.FALSE;
    pVars[channel][0].setToken(tok);
    tok=port.get(channel);
    if (_debugging) {
      _debug(port.getName(),"String_Node_Str",tok.toString());
    }
    if (_debug_info) {
      System.out.println("String_Node_Str" + port.getName() + "String_Node_Str"+ tok.toString());
    }
    pVars[channel][1].setToken(tok);
  }
}

Fixed version (ground truth):
/** 
 * Set the input variables for the channel of the port.
 * @param port An input port of this actor.
 * @param channel A channel of the input port.
 * @param firings The number of times this actor has been fired in thecurrent iteration - 1. If the firing count of this actor is M, then the value of this parameter ranges from 0 to M-1.
 * @param firingsPerIteration The firing count of this actorin the current iteration.
 * @exception IllegalActionException If the port is not contained bythis actor, or if the port is not an input port, or if the value variable cannot take the token read from the channel.
 */
protected void _setInputVariables(TypedIOPort port,int channel,int firings,int firingsPerIteration) throws IllegalActionException {
  if (port.getContainer() != this) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  if (!port.isInput()) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  if (_debug_info) {
    System.out.println(this.getFullName() + "String_Node_Str" + port.getName());
  }
  int width=port.getWidth();
  Variable[][] pVars=(Variable[][])_inputVariableMap.get(port);
  if (pVars == null) {
    throw new InternalErrorException(getName() + "String_Node_Str" + "String_Node_Str"+ port.getName()+ "String_Node_Str");
  }
  Variable[][] hdfVars=(Variable[][])_hdfInputVariableMap.get(port);
  if (hdfVars == null) {
    throw new InternalErrorException(getName() + "String_Node_Str" + "String_Node_Str"+ port.getName()+ "String_Node_Str");
  }
  Token tok;
  boolean t;
  int currentTokenIndex=0;
  while (t=port.hasToken(channel)) {
    if (_debug_info) {
      System.out.println(port.getName() + "String_Node_Str" + t);
    }
    if (_debug_info) {
      System.out.println("String_Node_Str" + port.getName() + "String_Node_Str"+ t);
    }
    tok=t ? BooleanToken.TRUE : BooleanToken.FALSE;
    pVars[channel][0].setToken(tok);
    tok=port.get(channel);
    if (_debug_info) {
      System.out.println(port.getName() + "String_Node_Str" + tok.toString());
    }
    if (_debug_info) {
      System.out.println("String_Node_Str" + port.getName() + "String_Node_Str"+ tok.toString());
    }
    pVars[channel][1].setToken(tok);
    int portRate=SDFScheduler.getTokenConsumptionRate(port);
    int index=firingsPerIteration * portRate - 1 - (firings * portRate + currentTokenIndex);
    int historySize=((IntToken)(tokenHistorySize.getToken())).intValue();
    if (index < historySize) {
      hdfVars[channel][index].setToken(tok);
    }
    currentTokenIndex++;
  }
}