[前][次][番号順一覧][スレッド一覧]

ruby-changes:11911

From: nobu <ko1@a...>
Date: Tue, 26 May 2009 09:22:32 +0900 (JST)
Subject: [ruby-changes:11911] Ruby:r23572 (trunk): * parse.y (parser_yyerror): get rid of possible overflow.

nobu	2009-05-26 09:22:20 +0900 (Tue, 26 May 2009)

  New Revision: 23572

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23572

  Log:
    * parse.y (parser_yyerror): get rid of possible overflow.

  Modified files:
    trunk/parse.y

Index: parse.y
===================================================================
--- parse.y	(revision 23571)
+++ parse.y	(revision 23572)
@@ -4885,7 +4885,8 @@
     const int max_line_margin = 30;
     const char *p, *pe;
     char *buf;
-    int len, i;
+    long len;
+    int i;
 
     compile_error(PARSER_ARG "%s", msg);
     p = lex_p;
@@ -4922,7 +4923,7 @@
 	buf[len] = '\0';
 	rb_compile_error_append("%s%s%s", pre, buf, post);
 
-	i = lex_p - p;
+	i = (int)(lex_p - p);
 	p2 = buf; pe = buf + len;
 
 	while (p2 < pe) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]