lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

I just noticed what I consider to be a slight misbehavior in the startpc field 
of local variable declarations. In test/fibfor.lua, we have

    local a,b = 1, 1

which generates the following code:
        1       [5]     LOADK           0 -1    ; 1
        2       [5]     LOADK           1 -1    ; 1

So far, so good. However, the value of startpc for both locals is 2.
(luac -l -l in Lua5.1work2 displays it as 3 because it sums 1 to the value).

locals (2) for 0x805e2c0:
        0       a       3       14
        1       b       3       14

Shouldn't the values be different, since each local actually starts its scope 
at a different pc?

-- Hisham