== has a higher precedence operator than &.
So the line `$chunkLength & 1 == 1` is interepreted as:
`$chunkLength & true`. Probably not what was intended, but it actually
works out because true is cast to 1, and the expression will either
result with 0 (falsey) or 1 (truthy), and we were looking for it to
equal 1 anyways. Incredible.
I assume that it was supposed to be `( $chunkLength & 1 ) == 1`, so I've
modified it to use that.
Change-Id: If03823b9286e0d8282519949bf46e2ba4cca0843
// approximate error count: 127
"PhanParamTooMany",
// approximate error count: 2
// approximate error count: 127
"PhanParamTooMany",
// approximate error count: 2
- "PhanPluginDuplicateExpressionBinaryOp",
- // approximate error count: 2
"PhanTraitParentReference",
// approximate error count: 30
"PhanTypeArraySuspicious",
"PhanTraitParentReference",
// approximate error count: 30
"PhanTypeArraySuspicious",
$this->dumpForm( $file, $chunkLength, $indent + 1 );
} else {
fseek( $file, $chunkLength, SEEK_CUR );
$this->dumpForm( $file, $chunkLength, $indent + 1 );
} else {
fseek( $file, $chunkLength, SEEK_CUR );
- if ( $chunkLength & 1 == 1 ) {
+ if ( ( $chunkLength & 1 ) == 1 ) {
// Padding byte between chunks
fseek( $file, 1, SEEK_CUR );
}
// Padding byte between chunks
fseek( $file, 1, SEEK_CUR );
}
private function skipChunk( $file, $chunkLength ) {
fseek( $file, $chunkLength, SEEK_CUR );
private function skipChunk( $file, $chunkLength ) {
fseek( $file, $chunkLength, SEEK_CUR );
- if ( $chunkLength & 0x01 == 1 && !feof( $file ) ) {
+ if ( ( $chunkLength & 0x01 ) == 1 && !feof( $file ) ) {
// padding byte
fseek( $file, 1, SEEK_CUR );
}
// padding byte
fseek( $file, 1, SEEK_CUR );
}