Bug in Flash Player 11.0.1.152: 1/Math.abs(0) is -Infinity

AnyChart Team has found in Flash Player 11.0.1.152 a very weird bug that doesn’t manifest itself in the Debug version of Flash Player, but ruins math in the regular version, so we had to debug it in the non-debug version: using ExternalInterface and JavaScript console.

Bug description

In the regular version of Flash Player 11.0.1.152 the following expression:

1/Math.abs(0)

is evaluated as -Infinity, but in the Debug version it is (as anyone expects): Infinity

Reproduce

Here is a sample code you can use to reproduce this issue:

package {
    import flash.display.Sprite;
    import flash.external.ExternalInterface;

    public class MagicWorld extends Sprite {
        public function MagicWorld() {
            ExternalInterface.call("alert", "1/Math.abs(0) = " + (1/Math.abs(0)).toString());
        }
    }
}

As soon as you have done this — compile and run the sample in the Debug and Regular versions, and you will see the difference.

The bug has been reported to Adobe: Bug#3011557
The test sample: http://anychart.com/temp/bug301157/index.html

Leave a Reply