[phc-internals] [phc] r3400 committed - Simplify bug0035.php, and fix the bug.

phc at googlecode.com phc at googlecode.com
Sun Oct 31 23:49:38 GMT 2010


Revision: 3400
Author: paul.biggar
Date: Sun Oct 31 16:39:46 2010
Log: Simplify bug0035.php, and fix the bug.

http://code.google.com/p/phc/source/detail?r=3400

Modified:
  /trunk/src/ast_to_hir/AST_annotate.cpp
  /trunk/test/subjects/bugs/bug0035.php

=======================================
--- /trunk/src/ast_to_hir/AST_annotate.cpp	Sun Oct 26 11:10:59 2008
+++ /trunk/src/ast_to_hir/AST_annotate.cpp	Sun Oct 31 16:39:46 2010
@@ -34,7 +34,8 @@
  		in->variable->attrs->set_true("phc.ast_lower_expr.no_temp");

  	// Don't shred $$x = $y (do shred $$x[$i] = $y; dont shred $x->$$f = $y))
-	if (in->variable->variable_name->classid() == Reflection::ID
+	if (in->variable->target == NULL
+		&& in->variable->variable_name->classid() == Reflection::ID
  		&& in->variable->array_indices->size () == 0)
  		in->variable->attrs->set_true("phc.ast_lower_expr.no_temp");

=======================================
--- /trunk/test/subjects/bugs/bug0035.php	Fri Oct 29 04:10:17 2010
+++ /trunk/test/subjects/bugs/bug0035.php	Sun Oct 31 16:39:46 2010
@@ -1,30 +1,12 @@
  <?php

-/*
- * Issue 130, reported by catapuit2000-php at yahoo.de.
- *
- * The return statement does not properly shred, and doesn't convert  
properly
- * to HIR because of the field access.
- */
-
-class X
-{
-	function __construct ()
-	{
-		$this->propertyName = "str";
+	function x5()
+	{
+		$x = object();
+		$y = "asd";
+		return ($x->$y = 5);
  	}

-	function checkColor( &$color )
-	{
-		return $color;
-	}
-
-	function __get( $propertyName )
-	{
-		return ( $this->$propertyName = $this->checkColor( $this->$propertyName  
) );
-	}
-}
-
-$x = new X();
+	x5();

  ?>


More information about the phc-internals mailing list