错误#1030:堆栈深度不对称堆栈、不对称、深度、错误

2023-09-08 13:14:40 作者:灵魂焚毁一座荒芜

我有这个奇怪的问题,在此code:

I've got this strange problem where this code:

private function initLevel():void {
    var levelMap:Array = 
    [ 
           [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
           [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    ];
    for (var y:* in levelMap) {
        for (var x:* in levelMap[y]) {
            trace(y, x);
            trace(levelMap[y, x]);
        }
    }
}

生产这种丑陋的怪物的FlashDevelop:

produces this ugly monster in flashdevelop:


typecheck Level/initLevel()
  outer-scope = [global Object$ flash.events::EventDispatcher$ flash.display::DisplayObject$ flash.display::InteractiveObject$ flash.display::DisplayObjectContainer$ flash.display::Sprite$ flash.display::MovieClip$ Level$]
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {} ()
  0:debugfile "L:\svntest\flashgame\src;com\thom\TD;Level.as"
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {} ()
  2:debugline 66
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {} ()
  4:getlocal0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {} (Level[O])
  5:pushscope
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} ()
  6:pushundefined
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (void[A])
  7:coerce_a
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (*[A])
  8:setlocal2
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} ()
  9:pushundefined
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (void[A])
  10:coerce_a
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (*[A])
  11:setlocal3
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} ()
  12:debug
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} ()
  17:debug
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} ()
  22:debugline 69
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} ()
  24:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I])
  26:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I])
  28:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I])
  30:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I])
  32:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I])
  34:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I])
  36:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  38:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  40:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  42:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  44:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  46:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  48:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  50:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  52:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  54:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  56:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  58:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  60:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  62:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  64:newarray 20
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O])
  66:debugline 70
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O])
  68:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I])
  70:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I])
  72:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I])
  74:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I])
  76:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I])
  78:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I])
  80:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  82:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  84:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  86:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  88:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  90:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  92:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  94:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  96:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  98:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  100:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  102:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  104:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  106:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (...10: int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  108:newarray 20
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O])
  110:debugline 71
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O])
  112:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I])
  114:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I])
  116:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I])
  118:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I])
  120:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I])
  122:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I])
  124:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  126:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  128:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  130:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  132:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  134:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  136:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  138:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  140:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  142:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  144:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  146:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  148:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (...10: Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  150:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (...11: int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  152:newarray 20
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O])
  154:debugline 72
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O])
  156:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I])
  158:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I])
  160:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I])
  162:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I])
  164:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I])
  166:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I])
  168:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  170:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  172:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  174:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  176:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  178:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  180:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  182:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  184:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  186:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  188:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  190:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (...10: Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  192:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (...11: Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  194:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (...12: int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  196:newarray 20
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O])
  198:debugline 73
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O])
  200:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I])
  202:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I])
  204:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I])
  206:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I])
  208:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I])
  210:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I])
  212:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  214:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  216:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  218:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  220:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  222:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  224:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  226:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  228:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  230:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (Array[O] Array[O] Array[O] Array[O] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I] int[I])
  232:pushbyte 0
                       [Level[O] *[A] *[A] *[A] *[A] *[A] *[A] *[A]] {Level[O]} (...10: Array[O] 
//SIXTY THOUSAND CHAR SNIP  
  804:callproperty trace 1
                       [Level[O] Array[O] *[A] *[A] int[I] *[A] int[I] *[A]] {Level[O]} (global[O] *[A])
  807:pop
                       [Level[O] Array[O] *[A] *[A] int[I] *[A] int[I] *[A]] {Level[O]} (global[O])
------------------------------------
MERGE CURRENT 808:     [Level[O] Array[O] *[A] *[A] int[I] *[A] int[I] *[A]] {Level[O]} (global[O])
MERGE TARGET B808:     [Level[O] Array[O] *[A] *[A] int[I] *[A] int[I] *[A]] {Level[O]} ()
[Fault] exception, information=VerifyError: Error #1030: Stack depth is unbalanced. 1 != 0.

我认为这是与作用域或类似的东西,但我难住了。

I think it has something to do with scoping or something like that, but I am stumped.

感谢您的帮助提前

推荐答案

AI在previous评论说,我认为这是一个编译器缺陷的基础上,简单的事实,编译器产生非法字节code和玩家能够抓住这个畸形的字节code和抛出一个的VerifyError 相应。

A I said in previous comments, I think this is a compiler bug, based on the simple fact that the compiler produced illegal bytecode and the player was able to catch this malformed bytecode and throw a VerifyError accordingly.

然而,在一些调查,我发现了几个有趣的事情。

However, upon some investigation, I found a couple of interesting things.

首先,Joony的调查结果让我在正确的轨道上。很显然,他的code显示,你可以欺骗编译成翻译有什么方括号的属性访问的。

First, Joony's findings put me in the right track. Apparently, as his code shows, you can trick the compiler into translating what's between the square brackets as a property access.

那么,这样的:

foo[foo,'length']

等同于:

foo["length"] 

有一个问题就在这里,但我会在第二个解释。

There's a problem here, but I'll explain it in a second.

您也可以拨打方式,像这样的:

You can also call methods, like this:

var foo:Array = [];
foo[foo,'push'](1);
trace(foo);

这将有力地推动 1

对于某些additionaly挂羊头卖狗肉,您可以链接这一切让这个讨厌的野兽:

With some additionaly trickery, you can chain all this to get this nasty beast:

var inner:Array     = [10];
var outter:Array    = [1,2,inner];
(inner[outter, 'pop']).call(null)[inner,'push'].call(null,20);

trace(inner);
trace(outter);

这是等价于:

var inner:Array     = [10];
var outter:Array    = [1,2,inner];
outter.pop().push(20);

这就是我们流行 outter 键,然后按 20 给它。

That is, we pop inner from outter and then push 20 to it.

我开始注意到,这里

inner[outter, 'pop']

不被使用。

其实,你可以将其更改为:

In fact, you can change it to:

null[outter,'pop']

甚至

(void)[outter,'pop']

和编译器不会抱怨(既会做的播放器)。我怀疑上面是有效的ActionScript sintactically(在这种情况下,编译器应该拒绝编译),但我不是100%肯定。然而,这种未使用的对象是问题的根源。 (以下要求如何闪光灯组件或任何其他基于堆栈的组装工作的一些基本知识,但我希望我可以解释,以便它可以在不承担太多的理解。)

And the compiler won't complain about it (neither will do the player). I doubt the above is valid Actionscript sintactically (in which case the compiler should refuse to compile it), but I'm not 100% sure. However, this unused object is the root of the problem. (The following requires some basic knowledge of how flash assembly or any other stack based assembly works, but I hope I can explain it so it can be understood without assuming too much.)

我拆开这个动作code生成的字节code:

I disassembled the bytecode generated by this actionscript code:

var arr:Array = [10];
null[arr,'length'];

拆解code:

Disassembled code:

function private::initLevel():void  /* disp_id 0*/
{
  // local_count=2 max_scope=1 max_stack=3 code_len=17
  0     getlocal0       
  1     pushscope       
  2     pushbyte        10
  4     newarray        [1]
  6     coerce          Array
  8     setlocal1       
  9     pushnull        
  10    getlocal1       
  11    pushstring      "length"
  13    getproperty     null
  15    pop             
  16    returnvoid      
}

让我们一步一步来。该指令的指令输入的偏移; stack_state 显示在执行指令后堆栈的当前状态; 评论是不言自明;)

Let's go step by step. instr is the offset of the instruction; stack_state shows the current state of the stack after the instruction is executed; comments is self-explanatory ;)

  instr stack_state             comments
  -------------------------------------------------------------------------------------------      
  0     this                    "this" is always passed in local register 0 to instance methods
  1                             "this" is added to the scope chain and popped
  2     10                      now, we have 10 on the stack    
  4     [10]                    an array is created and initialized taking 1 element from the stack
  6     [10]                    this is sort of like doing [10] as Array
  8                             the array is assigned to local variable 1
  9     null                    null is pushed. That is the null in this line:
                                null[arr,'length']
                                HERE BEGINS THE PROBLEM!
  10    null,local1             local 1 is pushed
  11    null,local1,"length"    the string constant "length" is pushed
  13    null,local1["length"]   getproperty null is used for dynamic lookup (object["prop"]). Both operands are popped from the stack
  15    null                    in the previous step, the result of local1["lengtht"] was pushed. But we dind't use it, so it's discarded
  16    null                    here the method returns. The stack should be empty, but it's not. 
                                The generated code should have popped the null pushed at #9, 
                                or it shouldn't have pushed it in the first place

的问题是,在离开方法后,所有的对象由高度重视和已被弹出的方法压入堆栈。这种情况并非如此,因为恒遗体堆栈中的方法返回后。换句话说,我们有一个的不平衡堆栈的。现在,玩家显然不介意或者不检查。我想这应该和不应该运行此code,因为这可能(至少是可能)会导致堆栈溢出,如果这个变大就好了。

The problem is that after leaving the method, all of the objects pushed onto the stack by the method sould have been popped. This is not the case, as the null constant remains on the stack after the method returns. In other words, we have an unbalanced stack. Now, the player apparently doesn't mind or doesn't check. I think it should, and should not run this code, since this could (at least potentially) lead to a stack overflow if this grows bigger enough.

现在,如果我们改变问题的code部分包括一个跳块内(如后像一个条件跳转到达块如果),球员拒绝code的消息:

Now, if we change the problematic code section to be included within a jump block (such as the block reached after a conditional jump like an if), the player rejects the code with the message:

VerifyError: Error #1030: Stack depth is unbalanced. 1 != 0.

同为OP。因此,似乎一个分支的presence触发某种检查在玩家堆栈完整性。在这一点上,应该指出的是,一个ActionScript循环(任何一种形式的循环)在字节code级为条件跳转实现的,就像一个如果 。所以,即使我们没有在以下code循环(一个如果产生code表示更短,更简单的分析),因为它触发此检查的球员,我们的目的,它同样具有一个循环,作为OP一样。

The same as the OP. So, it seems that the presence of a branch triggers some kind of check for stack integrity in the player. At this point, it should be noted that an Actionscript loop (any kind of loop) is implemented at the bytecode level as a conditional jump, just like an ìf. So, even though we don't have a loop in the following code (an if produces code that is shorter and simpler to analyze), since it triggers this check in the player, for our purposes, it's the same as having a loop, as the OP did.

在AS code:

var dummy:int = 1;
var arr:Array = [10];
if(dummy != 0) {
    null[arr,'length'];
}

拆解:

function private::initLevel():void  /* disp_id 0*/
{
  // local_count=3 max_scope=1 max_stack=3 code_len=27
  0     getlocal0       
  1     pushscope       
  2     pushbyte        1
  4     setlocal1       
  5     pushbyte        10
  7     newarray        [1]
  9     coerce          Array
  11    setlocal2       
  12    getlocal1       
  13    pushbyte        0
  15    ifeq            L1

  19    pushnull        
  20    getlocal2       
  21    pushstring      "length"
  23    getproperty     null
  25    pop             

  L1: 
  26    returnvoid      
}

步骤一步:

  instr stack_state             comments
  -------------------------------------------------------------------------------------------      
  0     this                    "this" is always passed in local register 0 to instance methods    
  1                             "this" is added to the scope chain and popped
  2     1                       now, we have 1 on the stack    
  4                             1 is popped and assigned to the local variable 1 (the dummy var in the code)
  5     10                      10 is pushed
  7     [10]                    an array is created and initialized taking 1 element from the stack
  9     [10]                    this is sort of like doing [10] as Array
  11                            the array is assigned to local variable 2 (the arr var in the code)
  12    local1                  local1 (dummy) is pushed
  13    local1,0                0 is pushed
  15                            this instruction consumes (pops) both local1 and 0 to compare them
                                If this condition is satisfied, it jumps to the label L1
                                If it is not, it falls-through to the next instruction 
                                (the same as a case label in a switch statement that does not have a break, in Actionscript code)
  19    null                    null is pushed. That is the null in this line:
                                null[arr,'length']  
                                Again, HERE BEGINS THE PROBLEM!
  20    null,local2             local2 is pushed
  21    null,local2,"length"    the string constant "length" is pushed
  23    null,local2["length"]   getproperty null is used for dynamic lookup (object["prop"]). Both operands are popped from the stack
  25    null                    the value returned by local2["length"] is discarded

  26    null                    the method returns, but null is not properly popped from the stack!

所以,再次,仍是该方法返回后在堆栈上;堆栈的不平衡的。但是这一次,玩家检查此,发现问题,抛出一个的VerifyError 并中止code。

So, again, null is still on the stack after the method returns; the stack is unbalanced. But this time, the player checks this, finds the problem, throws a VerifyError and aborts the code.

在任何情况下,把它包起来,我的结论是:编译器生成非法字节code。在这两种情况下。我认为这是一个错误。玩家拒绝这个code。如果它能够探测到它。但现在看来,这只是能够检测到它,如果有问题的code是一个跳块内(看起来像一个错误,太)。

At any rate, to wrap it up, my conclusions are: the compiler generates illegal bytecode in both cases. I think this is a bug. The player rejects this code if it's able to detect it. But it seems it's only able to detect it if the problematic code is within a jump block (looks like a bug, too).

附录:

Joony提到了评论,如果你跳那么没有错误,然后立即返回。这是事实。其原因是,中,但是如果恢复后code是死code,所以编译器带它关闭字节code。

Joony mentions in a comment that "If you return immediately before the jump then no error". Which is true. The reason is that the code within the if but after the return is "dead code", so the compiler strips it off the bytecode.

所以,它不是跳跃本身是什么原因导致玩家检查堆栈的完整性。我用Google搜索了一下,发现这在haXe的网站。

So, it's not the jump itself what causes the player to check for stack integrity. I googled a bit and found this on the haxe site.

这是一个堆栈不平衡的错误。   这意味着这两者的分支   跳转导致不同的堆栈大小   当他们一起回来。所有跳跃或code   导致给定的位置应   导致相同的堆栈大小

This is a stack unbalanced error. It means that two branches of a Jump result in different stack sizes when they join back. All jumps or code leading to a given position should result in the same stack size.

这使得这一切更加清晰。

Which makes it all more clear.

在第二code上面的例子,这就是实际发生。

In the second code example above, that is what's actually happening.

如果所述code跟跳跃在指令15中,它的土地上直接的最后一条指令(26)返回给调用者。 尚未推,并没有别的是在栈上,所以我们在这一点上为0的堆栈大小到达。

If the code follows the jump at instruction 15, it lands directly on the last instruction (26) to return to the caller. null has not been pushed and nothing else is on the stack, so we arrive at this point with a stack size of 0.

如果在code不跳,落在通,将被推迟(19),而不是弹出。因此,这条道路将达到最后一个指令(26)在堆栈上,这意味着堆栈大小为1,这最后的指令的地步,这两个分支连接回,但下面的一个分支,该堆栈大小为0,而下面的另一个,这是1这是什么原因导致玩家抱怨不平衡堆栈。

If the code doesn't jump and falls-through, null will be pushed (19) and not popped off. So, this path will reach the last instruction (26) with null on the stack, which means the stack size is 1. This last instruction is the point where both branches join back, but following one branch, the stack size is 0, while following the other, it's 1. And this is what causes the player to complain about an unbalanced stack.