aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-08-17 15:59:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-08-17 15:59:28 -0300
commit9b4f39ab14fb2e55345c3d23537d129dac23b091 (patch)
treec7e11448e4d6eb1fec6e0a6d58544f17b1a39e10 /lstate.c
parentf4211a5ea4e235ccfa8b8dfa46031c23e9e839e2 (diff)
downloadlua-9b4f39ab14fb2e55345c3d23537d129dac23b091.tar.gz
lua-9b4f39ab14fb2e55345c3d23537d129dac23b091.tar.bz2
lua-9b4f39ab14fb2e55345c3d23537d129dac23b091.zip
More disciplined use of 'getstr' and 'tsslen'
We may want to add other string variants in the future; this change documents better where the code may need to handle those variants.
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lstate.c b/lstate.c
index 06667dac..7fefacba 100644
--- a/lstate.c
+++ b/lstate.c
@@ -433,7 +433,7 @@ void luaE_warning (lua_State *L, const char *msg, int tocont) {
433void luaE_warnerror (lua_State *L, const char *where) { 433void luaE_warnerror (lua_State *L, const char *where) {
434 TValue *errobj = s2v(L->top.p - 1); /* error object */ 434 TValue *errobj = s2v(L->top.p - 1); /* error object */
435 const char *msg = (ttisstring(errobj)) 435 const char *msg = (ttisstring(errobj))
436 ? svalue(errobj) 436 ? getstr(tsvalue(errobj))
437 : "error object is not a string"; 437 : "error object is not a string";
438 /* produce warning "error in %s (%s)" (where, msg) */ 438 /* produce warning "error in %s (%s)" (where, msg) */
439 luaE_warning(L, "error in ", 1); 439 luaE_warning(L, "error in ", 1);