Reviewers: scottb,

Description:
This patch adds -XcheckOverflow to the compiler, which will generate
code that checks every non-long primitive arithmetic operation to see if
overflow should have occurred, and throw an assertion error.  This
catches the case where in production mode (where everything is
calculated as a double), a value that would have wrapped around now
doesn't, leading to an out-of-range condition which may behave
strangely.  For example, hash functions frequently rely on overflow.

Please review this at http://gwt-code-reviews.appspot.com/126801

Affected files:
   dev/core/src/com/google/gwt/dev/Precompile.java
   dev/core/src/com/google/gwt/dev/jjs/JJSOptions.java
   dev/core/src/com/google/gwt/dev/jjs/JJSOptionsImpl.java
   dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
   dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
   dev/core/src/com/google/gwt/dev/jjs/impl/OverflowDetectionNormalizer.java
   dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerCheckOverflow.java
   dev/core/src/com/google/gwt/dev/util/arg/OptionCheckOverflow.java
    
dev/core/super/com/google/gwt/dev/jjs/intrinsic/com/google/gwt/lang/Overflow.java
   user/src/com/google/gwt/junit/JUnitShell.java


-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to