[kaffe] CVS kaffe-extras (guilhem): Fix for KJC: check for real unreachable blocks in a if statement.

Kaffe CVS cvs-commits at kaffe.org
Sat May 22 10:35:02 PDT 2004


PatchSet 35 
Date: 2004/05/22 17:34:48
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fix for KJC: check for real unreachable blocks in a if statement.

        * kjc/JIfStatement.java
        (analyse): Check whether the context is actually reachable. It is the
        case if the condition is a constant.

Members: 
	patches/kjc-kaffe.diff:1.2->1.3 

Index: kaffe-extras/patches/kjc-kaffe.diff
diff -u kaffe-extras/patches/kjc-kaffe.diff:1.2 kaffe-extras/patches/kjc-kaffe.diff:1.3
--- kaffe-extras/patches/kjc-kaffe.diff:1.2	Sat May 22 16:36:23 2004
+++ kaffe-extras/patches/kjc-kaffe.diff	Sat May 22 17:34:48 2004
@@ -1,7 +1,13 @@
 diff -N ChangeLog
 --- /dev/null	1 Jan 1970 00:00:00 -0000
-+++ ChangeLog	22 May 2004 11:32:18 -0000	1.1
-@@ -0,0 +1,8 @@
++++ ChangeLog	22 May 2004 17:20:46 -0000
+@@ -0,0 +1,14 @@
++2004-05-22  Guilhem Lavaux <guilhem at kaffe.org>
++
++	* kjc/JIfStatement.java
++	(analyse): Check whether the context is actually reachable. It is the
++	case if the condition is a constant.
++
 +2004-05-22  Guilhem Lavaux <guilhem at kaffe.org>
 +	
 +	* ChangeLog: new file.
@@ -815,7 +821,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -926,7 +932,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +// Import the necessary classes
@@ -2399,7 +2405,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -4619,7 +4625,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +package at.dms.ksm
@@ -4771,7 +4777,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +prefix Ksm
@@ -8017,7 +8023,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -8104,7 +8110,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -8296,7 +8302,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -8405,7 +8411,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +package at.dms.ksm;
@@ -8471,7 +8477,7 @@
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + *
-+ * $Id: kjc-kaffe.diff,v 1.2 2004/05/22 16:36:23 guilhem Exp $
++ * $Id: kjc-kaffe.diff,v 1.3 2004/05/22 17:34:48 guilhem Exp $
 + */
 +
 +aaload ......... :
@@ -35341,10 +35347,22 @@
    }
  
    // ----------------------------------------------------------------------
-diff -u -r1.1.1.1 -r1.2
+diff -u -r1.1.1.1 -r1.3
 --- kjc/JIfStatement.java	6 Apr 2004 16:59:27 -0000	1.1.1.1
-+++ kjc/JIfStatement.java	10 Apr 2004 10:28:44 -0000	1.2
-@@ -105,7 +105,6 @@
++++ kjc/JIfStatement.java	22 May 2004 17:19:24 -0000	1.3
+@@ -85,7 +85,10 @@
+     thenClause.analyse(thenContext);
+ 
+     if (elseClause == null) {
+-      context.merge(thenContext);
++      if (!cond.isConstant())
++        context.merge(thenContext);
++      else
++	context.adopt(thenContext);
+     } else {
+       elseClause.analyse(context);
+       if (thenContext.isReachable() && context.isReachable()) {
+@@ -105,7 +108,6 @@
     * @param	p		the visitor
     */
    public void accept(KjcVisitor p) {




More information about the kaffe mailing list