From 8004798b0374744208b102bb4cbcf12f904ea120 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 4 Apr 2019 16:31:24 -0300 Subject: Fixed wrong error message in 'return math.seed(0)' Bug introduced in commit 28d829c8: OP_TAILCALL might raise an error without saving 'pc'. (This commit also fixes a detail in 'testes/uf8.lua'.) --- testes/errors.lua | 4 ++++ testes/utf8.lua | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'testes') diff --git a/testes/errors.lua b/testes/errors.lua index 74975e31..0b12410e 100644 --- a/testes/errors.lua +++ b/testes/errors.lua @@ -99,6 +99,10 @@ assert(not string.find(doit"a={13}; local bbbb=1; a[bbbb](3)", "'bbbb'")) checkmessage("a={13}; local bbbb=1; a[bbbb](3)", "number") checkmessage("a=(1)..{}", "a table value") +-- tail calls +checkmessage("local a={}; return a.bbbb(3)", "field 'bbbb'") +checkmessage("a={}; do local a=1 end; return a:bbbb(3)", "method 'bbbb'") + checkmessage("a = #print", "length of a function value") checkmessage("a = #3", "length of a number value") diff --git a/testes/utf8.lua b/testes/utf8.lua index b3b7687f..acbb181d 100644 --- a/testes/utf8.lua +++ b/testes/utf8.lua @@ -66,7 +66,7 @@ local function check (s, t, nonstrict) assert(utf8.len(s, pi, pi1 - 1, nonstrict) == 1) assert(utf8.len(s, pi, -1, nonstrict) == l - i + 1) assert(utf8.len(s, pi1, -1, nonstrict) == l - i) - assert(utf8.len(s, 1, pi, -1, nonstrict) == i) + assert(utf8.len(s, 1, pi, nonstrict) == i) end local i = 0 -- cgit v1.2.3-55-g6feb