09b97f8336
Fixes HHIR bugs that were causing perflab crashes: guards on class types and tvBox. We were ignoring stack guards on class, which was causing the IR to lose track of types for classes on the stack and causing assertion failures. Fixed by making class stack type guards into stack type asserts. tvBox was not returning the right value, causing VGetS to crash in the IR. Changed 1 test and added another to cover VGetS in verify_quick_hhir.
43 linhas
555 B
PHP
43 linhas
555 B
PHP
<?php
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
print "Test begin\n";
|
|
|
|
class A {
|
|
static public $a = 1;
|
|
static public function setA($val) {
|
|
self::$a =& $val;
|
|
}
|
|
}
|
|
|
|
function main(){
|
|
echo "main\n";
|
|
A::$a = 30;
|
|
$x =& A::$a;
|
|
print($x.A::$a."\n");
|
|
$x = 5;
|
|
print($x.A::$a."\n");
|
|
}
|
|
|
|
function main2($name){
|
|
echo "main2\n";
|
|
$name::$a = 30;
|
|
$x =& $name::$a;
|
|
print($x.$name::$a."\n");
|
|
$x = 5;
|
|
print($x.$name::$a."\n");
|
|
}
|
|
|
|
function main3() {
|
|
A::setA(5);
|
|
}
|
|
|
|
main();
|
|
main();
|
|
|
|
main2("A");
|
|
main2("A");
|
|
|
|
main3();
|
|
main3();
|