2 bugs and patches

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

2 bugs and patches

Edgar Toernig
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.


Reply | Threaded
Open this post in threaded view
|

Re: 2 bugs and patches

Luiz Henrique de Figueiredo
>From: Edgar Toernig <[hidden email]>

>1. tostring() without an argument generates a SEGV.

Oops, sorry about that. This will be fixed in the next version.
(On the other, hand, who would want to call tostring() without an argument :-)

>2. Something like "repeat until 1 %foo()" gives a syntax error.

This has been fixed in the next version.

Thanks for spoting these bugs.

--lhf