(0006646)
|
tobia
|
08-04-15 08:26
|
|
As a followup, I ran a bisect and found out that the bug was introduced between 4.0.38 and 4.0.39, in particular between r10174 and r10175. Therefore the bug was introduced as part of r10175, "quercus initial refactor of private methods/fields".
The problem seems to happen when a file that was just created (e.g. using "file_put_contents") is included (using "include") from inside a class method and the included file uses "$this". This is commonly used by templating engines, which fail to run under recent Quercus versions (since january 2014.)
If the included file is already present in the filesystem, the include seems to work.
When it fails (see attached test script, which fails every time) the problem is that the parser creates ThisExpr with _classDef = null and this causes a NPE later on when ThisFieldExpr.eval is called.
Here is the stacktrace of the creation, where the parses passes null (line numbers are relative to r10175):
ThisExpr.<init>(InterpretedClassDef) line: 51
ExprFactory.createThis(InterpretedClassDef) line: 240
QuercusParser.parseVariable() line: 3921
...
I haven't been able to find a workaround. |
|