From 8e1f25e3f80bbefbbd1e3de20caf255b95b4d9d6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 15 Mar 2004 18:09:55 -0300 Subject: [PATCH] bug in `dofile' --- bugs | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/bugs b/bugs index fcd27215..59af0765 100644 --- a/bugs +++ b/bugs @@ -450,11 +450,17 @@ pcall(co) report = [[Nick Trout, 07/07/2003]], patch = [[ * lvm.c: -402d401 +402,403c402,403 < L->ci->u.l.pc = &pc; -405a405 +< if (L->hookmask & LUA_MASKCALL) +--- +> if (L->hookmask & LUA_MASKCALL) { +> L->ci->u.l.pc = &pc; +404a405 +> } +405a407 > L->ci->u.l.pc = &pc; -676,678c676 +676,678c678 < lua_assert(ci->u.l.pc == &pc && < ttisfunction(ci->base - 1) && < (ci->state & CI_SAVEDPC)); @@ -579,7 +585,7 @@ patch = [[ } -Bugs = { +Bug{ what = [[count hook may be called without being set]], @@ -603,3 +609,27 @@ patch = [[ ]], } + + +Bug{ + +what = [[`dofile' eats one return value when called without arguments]], + +report = [[Frederico Abraham, 15/01/2004]], + +example = [[ +a,b = dofile() --< here you enter `return 1,2,3 ' +print(a,b) --> 2 3 (should be 1 and 2) +]], + +patch = [[ +* lbaselib.c: +313a314 +> int n = lua_gettop(L); +317c318 +< return lua_gettop(L) - 1; +--- +> return lua_gettop(L) - n; +]], + +}