mirror of
https://github.com/lua/lua.git
synced 2026-01-30 11:25:37 +00:00
Fixed missing case in 'luaV_finishOp'
A metamethod call like '1 << a' was not being properly resumed if it got yielded.
This commit is contained in:
parent
3df5624ff4
commit
643188d6e5
2
lvm.c
2
lvm.c
@ -727,7 +727,7 @@ void luaV_finishOp (lua_State *L) {
|
||||
case OP_MUL: case OP_DIV: case OP_IDIV:
|
||||
case OP_BANDK: case OP_BORK: case OP_BXORK:
|
||||
case OP_BAND: case OP_BOR: case OP_BXOR:
|
||||
case OP_SHRI: case OP_SHL: case OP_SHR:
|
||||
case OP_SHLI: case OP_SHRI: case OP_SHL: case OP_SHR:
|
||||
case OP_MOD: case OP_POW:
|
||||
case OP_UNM: case OP_BNOT: case OP_LEN:
|
||||
case OP_GETTABUP: case OP_GETTABLE: case OP_GETI:
|
||||
|
||||
@ -747,6 +747,12 @@ assert(run(function () return a >> b end, {"shr"}) == 10 >> 12)
|
||||
assert(run(function () return 10 & b end, {"band"}) == 10 & 12)
|
||||
assert(run(function () return a | 2 end, {"bor"}) == 10 | 2)
|
||||
assert(run(function () return a ~ 2 end, {"bxor"}) == 10 ~ 2)
|
||||
assert(run(function () return a >> 2 end, {"shr"}) == 10 >> 2)
|
||||
assert(run(function () return 1 >> a end, {"shr"}) == 1 >> 10)
|
||||
assert(run(function () return a << 2 end, {"shl"}) == 10 << 2)
|
||||
assert(run(function () return 1 << a end, {"shl"}) == 1 << 10)
|
||||
assert(run(function () return a ~ 2 end, {"bxor"}) == 10 ~ 2)
|
||||
|
||||
|
||||
assert(run(function () return a..b end, {"concat"}) == "1012")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user