Mantis - Quercus
Viewing Issue Advanced Details
2922 major always 09-11-08 09:41 09-11-08 14:16
koreth  
ferg  
normal  
closed 3.2.1  
fixed  
none    
none 3.2.1  
0002922: "(variable name) is not analyzed" error
The following is from our (open-source) Thrift communication library:

<?php
$GLOBALS['THRIFT_AUTOLOAD'] = array();
$GLOBALS['AUTOLOAD_HOOKS'] = array();

if (!function_exists('__autoload')) {
  function __autoload($class) {
    global $THRIFT_AUTOLOAD;
    $classl = strtolower($class);
    if (isset($THRIFT_AUTOLOAD[$classl])) {
      include_once $GLOBALS['THRIFT_ROOT'].'/packages'.$THRIFT_AUTOLOAD[$classl];
    } else if (!empty($GLOBALS['AUTOLOAD_HOOKS'])) {
      foreach ($GLOBALS['AUTOLOAD_HOOKS'] as $hook) {
        $hook($class);
      }
    }
  }
}

It fails to compile with the following exception:

[09:38:44.624] {resin-15} java.lang.IllegalStateException: Location[null:0]'$classl' is not analyzed.
[09:38:44.624] {resin-15} at com.caucho.quercus.expr.ProVarExpr$1.generateAssign(ProVarExpr.java:469)
[09:38:44.624] {resin-15} at com.caucho.quercus.expr.ProAssignExpr$1.generateTop(ProAssignExpr.java:90)
[09:38:44.624] {resin-15} at com.caucho.quercus.expr.GenerateExpr.generateStatement(GenerateExpr.java:338)
[09:38:44.624] {resin-15} at com.caucho.quercus.statement.ProExprStatement$1.generateImpl(ProExprStatement.java:92)
[09:38:44.624] {resin-15} at com.caucho.quercus.statement.StatementGenerator.generate(StatementGenerator.java:92)
[09:38:44.624] {resin-15} at com.caucho.quercus.statement.ProBlockStatement$1.generateImpl(ProBlockStatement.java:106)
[09:38:44.624] {resin-15} at com.caucho.quercus.statement.StatementGenerator.generate(StatementGenerator.java:92)
[09:38:44.624] {resin-15} at com.caucho.quercus.program.ProFunction$1.generateBody(ProFunction.java:472)
[09:38:44.624] {resin-15} at com.caucho.quercus.program.ProFunction$1.generateFixedArgs(ProFunction.java:268)
[09:38:44.624] {resin-15} at com.caucho.quercus.program.ProFunction$1.generate(ProFunction.java:205)
[09:38:44.624] {resin-15} at com.caucho.quercus.gen.QuercusMain.generate(QuercusMain.java:142)
[09:38:44.624] {resin-15} at com.caucho.java.gen.BaseClass.generateComponents(BaseClass.java:253)
[09:38:44.624] {resin-15} at com.caucho.java.gen.BaseClass.generateClassContent(BaseClass.java:240)
[09:38:44.624] {resin-15} at com.caucho.java.gen.BaseClass.generate(BaseClass.java:228)
[09:38:44.624] {resin-15} at com.caucho.java.gen.GenClass.generate(GenClass.java:123)
[09:38:44.624] {resin-15} at com.caucho.java.gen.JavaClassGenerator.generate(JavaClassGenerator.java:286)
[09:38:44.624] {resin-15} at com.caucho.quercus.gen.QuercusGenerator.generate(QuercusGenerator.java:117)
[09:38:44.624] {resin-15} at com.caucho.quercus.page.ProPageManager$CompileThread.run(ProPageManager.java:271)
[09:38:44.624] {resin-15} at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:759)
[09:38:44.624] {resin-15} at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:681)
[09:38:44.624] {resin-15} at java.lang.Thread.run(Thread.java:619)

Notes
(0003421)
ferg   
09-11-08 11:42   
I can't reproduce this as well. Is this the full example that reproduces the problem?
(0003422)
koreth   
09-11-08 11:56   
Yes, that's the entirety of the source file. I am running with the latest Pro and non-Pro code from svn. Just tried doing a clean build of all the Resin code and blowing away the Quercus work directory, then restarting Resin; I still see the exception.

Anything I can do to help diagnose? I'm happy to put debug messages in the Resin code if that'll help.
(0003427)
koreth   
09-11-08 13:53   
Updated Resin with latest changes from svn and the problem went away.
(0003429)
ferg   
09-11-08 14:16   
php/37f8