Browse Source

merge code from some guy. fix exit(1)

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1584 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
master
Xuefer 7 years ago
parent
commit
4279f1bc10
  1. 7
      devel/sample.cpp.php
  2. 12
      lib/Decompiler.class.php

7
devel/sample.cpp.php

@ -522,6 +522,8 @@ do {
} while (0);
#endif
list($a, $b) = array(1, 2);
if ('if()') {
echo 'if';
@ -544,6 +546,10 @@ else {
echo 'else';
}
if (!'if(!)') {
echo 'if(!)';
}
while (false) {
echo 'while';
}
@ -695,5 +701,6 @@ $callback = function($quantity, $product) use($tax, &$total) {
};
#endif
exit();
exit(1);
?>

12
lib/Decompiler.class.php

@ -671,7 +671,12 @@ class Decompiler
}
if (strpos($name, '\\') !== false) {
$this->namespace = strtok($name, '\\');
$namespace = strtok($name, '\\');
if ($namespace == $this->namespace) {
return;
}
$this->namespace = $namespace;
echo 'namespace ', $this->namespace, ";\n\n";
}
@ -1794,7 +1799,8 @@ class Decompiler
}
if (is_a($rvalue, 'Decompiler_Fetch')) {
$src = str($rvalue->src, $EX);
if ('$' . unquoteName($src) == $lvalue) {
$name = unquoteName($src);
if ('$' . $name == $lvalue) {
switch ($rvalue->fetchType) {
case ZEND_FETCH_STATIC:
$statics = &$EX['op_array']['static_variables'];
@ -2110,7 +2116,7 @@ class Decompiler
// }}}
case XC_EXIT: // {{{
$op1val = $this->getOpVal($op1, $EX);
$resvar = "exit($op1val)";
$resvar = "exit(" . str($op1val) . ")";
break;
// }}}
case XC_INIT_ARRAY:

Loading…
Cancel
Save