private void generateLogical(Expression expr) {
            Label trueLabel = mBuilder.createLabel();
            Label endLabel = mBuilder.createLabel();

            generateBranch(expr, trueLabel, true);

            Type type = expr.getInitialType();
            Class<?> clazz = type.getNaturalClass();

            if (clazz == boolean.class) {
                mBuilder.loadConstant(false);
                mBuilder.branch(endLabel);
                trueLabel.setLocation();
                mBuilder.loadConstant(true);
                endLabel.setLocation();
            }
            else if (clazz.isAssignableFrom(Boolean.class)) {
                TypeDesc td = makeDesc(Boolean.class);

                mBuilder.loadStaticField("java.lang.Boolean", "FALSE", td);
                mBuilder.branch(endLabel);
                trueLabel.setLocation();
                mBuilder.loadStaticField("java.lang.Boolean", "TRUE", td);
                endLabel.setLocation();
            }
            else if (clazz.isAssignableFrom(String.class)) {
                mBuilder.loadConstant("false");
                mBuilder.branch(endLabel);
                trueLabel.setLocation();
                mBuilder.loadConstant("true");
                endLabel.setLocation();
            }
            else {
                typeError(Type.BOOLEAN_TYPE, type);
            }
        }