derickr / vld

BSD 2-Clause "Simplified" License
464 stars 87 forks source link

Display for NEW does not mention classname #47

Closed jimmyleeeeee closed 4 years ago

jimmyleeeeee commented 4 years ago

When there is a class, we use vld to dump the instruction, we found that the dump result:
20 0* NEW $2 :17 The operand is only :17 ? How to get the class name by ":17" ?

jimmyleeeeee commented 4 years ago

Nobody answer ??

jimmyleeeeee commented 4 years ago

Thanks a lot. The issue has been resolved.

jimmyleeeeee commented 4 years ago

The issue of NEW instruction has been resolved. But , today, I met another issue. The php code is

class CConst{
    const MIN_VALUE=1;
    public static function getMinValue()
    {
        return self::MIN_VALUE;
    }
}
$const_var=new CConst();
$c=$const_var::MIN_VALUE;

The dumped code is :

  10     0*       NEW                                              $5      'CConst'
         1*       DO_FCALL                                      0
         2*       ASSIGN                                                   !0, $5
  11     3*       **FETCH_CLASS                                   0  <unknown> !0**
         4*       FETCH_CLASS_CONSTANT                             ~9      $8, 'MIN_VALUE'
         5*       ASSIGN                                                   !1, ~9

The return of FETCH_CLASS is **<unknown>**.

derickr commented 4 years ago

Please open a new issue for that. This one is closed, an they are unrelated cases.