lua-users home
lua-l archive

2 bugs and patches

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,
I found two bugs in lua 3.2:
1. tostring() without an argument generates a SEGV.
--- lbuiltin.c Sun Apr 2 19:15:41 2000
+++ lbuiltin.c Sun Apr 2 19:16:22 2000
@@ -328,7 +328,7 @@
 
 
 static void luaB_tostring (void) {
- lua_Object obj = lua_getparam(1);
+ lua_Object obj = luaL_nonnullarg(1);
 TObject *o = luaA_Address(obj);
 char buff[64];
 switch (ttype(o)) {
2. Something like "repeat until 1 %foo()" gives a syntax error.
 Looks, like '%' is missing in expfollow[]:
--- lparser.c Sun Apr 2 19:14:15 2000
+++ lparser.c Sun Apr 2 19:14:32 2000
@@ -598,7 +598,7 @@
 
 
 static int expfollow [] = {ELSE, ELSEIF, THEN, IF, WHILE, REPEAT, DO, NAME,
- LOCAL, FUNCTION, END, UNTIL, RETURN, ')', ']', '}', ';', EOS, ',', 0};
+ LOCAL, FUNCTION, END, UNTIL, RETURN, ')', ']', '}', ';', '%', EOS, ',', 0};
 
 
 static int is_in (int tok, int *toks) {
Ciao, ET.

AltStyle によって変換されたページ (->オリジナル) /