Page MenuHomePhabricator

CLDRPluralRuleParser\Converter calls $this->doOperation() incorrectly
Closed, ResolvedPublic

Description

CLDRPluralRuleParser\Converter calls $this->doOperation() with 2 parameters, but the function definition only has one

				while ( $lastOp && self::$precedence[$token->name] <= self::$precedence[$lastOp->name] ) {
					$this->doOperation( $lastOp, $this->operands );
					array_pop( $this->operators );
					$lastOp = end( $this->operators );
				}
		while ( $op = array_pop( $this->operators ) ) {
			$this->doOperation( $op, $this->operands );
		}
	protected function doOperation( Operator $op ) {
		if ( count( $this->operands ) < 2 ) {
			$op->error( 'missing operand' );
		}
		$right = array_pop( $this->operands );
		$left = array_pop( $this->operands );
		$result = $op->operate( $left, $right );
		$this->operands[] = $result;
	}

Event Timeline

Reedy assigned this task to Nikerabbit.
Reedy raised the priority of this task from to Needs Triage.
Reedy updated the task description. (Show Details)
Reedy added a project: I18n.
Reedy subscribed.

Not introduced in the split to its own package: https://github.com/wikimedia/mediawiki/blame/REL1_26/languages/utils/CLDRPluralRuleConverter.php

Marking as low because there doesn't seem to be any functionality issues caused by this.

Nemo_bis set Security to None.

Change 263571 had a related patch set uploaded (by MtDu):
Call doOperation function correctly in CLDRPluralRuleParser\Converter

https://gerrit.wikimedia.org/r/263571

Change 263571 merged by jenkins-bot:
Call doOperation function correctly in CLDRPluralRuleParser\Converter

https://gerrit.wikimedia.org/r/263571