aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-04-01 18:23:20 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-04-01 18:23:20 -0300
commitcae1eff9014ec7376f4faa6c5b0e6338382f3e82 (patch)
tree3efc4c7ea610bcfa4608c74dd3290fc1d87ac946
parentf83bc86e5140f929e616d6b885813513e62ed5fb (diff)
downloadlua-cae1eff9014ec7376f4faa6c5b0e6338382f3e82.tar.gz
lua-cae1eff9014ec7376f4faa6c5b0e6338382f3e82.tar.bz2
lua-cae1eff9014ec7376f4faa6c5b0e6338382f3e82.zip
small "bugs" detected by Purify: cannot read "next" after 0.
-rw-r--r--lex.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lex.c b/lex.c
index a019c6ef..0f64c758 100644
--- a/lex.c
+++ b/lex.c
@@ -1,4 +1,4 @@
1char *rcs_lex = "$Id: lex.c,v 2.43 1997/03/18 15:30:50 roberto Exp roberto $"; 1char *rcs_lex = "$Id: lex.c,v 2.44 1997/03/31 14:17:09 roberto Exp roberto $";
2 2
3 3
4#include <ctype.h> 4#include <ctype.h>
@@ -337,11 +337,13 @@ int luaY_lex (void)
337 return NUMBER; 337 return NUMBER;
338 } 338 }
339 339
340 default: /* also end of program (0) */ 340 case 0:
341 { 341 save(0);
342 return 0;
343
344 default:
342 save_and_next(); 345 save_and_next();
343 return yytext[0]; 346 return yytext[0];
344 }
345 } 347 }
346 } 348 }
347} 349}