]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: put exception checks inside of a G_UNLIKELY
authorEvan Nemerson <evan@nemerson.com>
Sat, 24 May 2014 22:08:57 +0000 (15:08 -0700)
committerLuca Bruno <luca.bruno@immobiliare.it>
Tue, 27 May 2014 08:29:53 +0000 (10:29 +0200)
Fixes bug 730702

codegen/valagerrormodule.vala

index 23d11a3137ffe0269e774e1e005988668a91d170..8b7ea1022b857f55ba4812f7986db8b0e180871e 100644 (file)
@@ -171,7 +171,9 @@ public class Vala.GErrorModule : CCodeDelegateModule {
                        // eliminates C warnings
                } else {
                        var ccond = new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, inner_error, new CCodeConstant ("NULL"));
-                       ccode.open_if (ccond);
+                       var unlikely = new CCodeFunctionCall (new CCodeIdentifier ("G_UNLIKELY"));
+                       unlikely.add_argument (ccond);
+                       ccode.open_if (unlikely);
                }
 
                if (current_try != null) {