Open viruscamp opened 10 years ago
local a,b,c,y
y = (a or b==c) -- assigne statement may be bool (calucate at last)
--[[
[1] testset 3 0 1 ; if R0 then R3 = R0 else pc+=1 (goto [3])
[2] jmp 4 ; pc+=4 (goto [7])
[3] eq 1 1 2 ; R1 == R2, pc+=1 (goto [5]) if false
[4] jmp 1 ; pc+=1 (goto [6])
[5] loadbool 3 0 1 ; R3 := false; PC := pc+=1 (goto [7])
[6] loadbool 3 1 0 ; R3 := true
[7] return 0 1 ; return
]]--
当赋值语句结果可能为bool,且bool值是最后才计算
https://github.com/viruscamp/luadec/issues/4#issuecomment-96223337
单独的 OP_JMP 跳到 OP_LOADBOOL 时,与 #1 相关 在 ProcessCode case:OP_JMP 到下列分支
基本确认这是错误的处理方法
测试代码