Fixed wrong error message in 'return math.seed(0)' · lua/lua@8004798 · GitHub
Skip to content

Commit 8004798

Browse files
committed
Fixed wrong error message in 'return math.seed(0)'
Bug introduced in commit 28d829c: OP_TAILCALL might raise an error without saving 'pc'. (This commit also fixes a detail in 'testes/uf8.lua'.)
1 parent 5ca1075 commit 8004798

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎lvm.c‎

Lines changed: 6 additions & 4 deletions

‎testes/errors.lua‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ assert(not string.find(doit"a={13}; local bbbb=1; a[bbbb](3)", "'bbbb'"))
9999
checkmessage("a={13}; local bbbb=1; a[bbbb](3)", "number")
100100
checkmessage("a=(1)..{}", "a table value")
101101

102+
-- tail calls
103+
checkmessage("local a={}; return a.bbbb(3)", "field 'bbbb'")
104+
checkmessage("a={}; do local a=1 end; return a:bbbb(3)", "method 'bbbb'")
105+
102106
checkmessage("a = #print", "length of a function value")
103107
checkmessage("a = #3", "length of a number value")
104108

‎testes/utf8.lua‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)