ruby-changes:18974
From: naruse <ko1@a...>
Date: Thu, 3 Mar 2011 01:27:31 +0900 (JST)
Subject: [ruby-changes:18974] Ruby:r31010 (trunk): * addr2line.c (uleb128): cast the value to unsigned long.
naruse 2011-03-03 01:14:32 +0900 (Thu, 03 Mar 2011) New Revision: 31010 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31010 Log: * addr2line.c (uleb128): cast the value to unsigned long. * addr2line.c (fill_lines): print error when lseek fails. Modified files: trunk/ChangeLog trunk/addr2line.c Index: ChangeLog =================================================================== --- ChangeLog (revision 31009) +++ ChangeLog (revision 31010) @@ -1,3 +1,9 @@ +Thu Mar 3 00:46:51 2011 NARUSE, Yui <naruse@r...> + + * addr2line.c (uleb128): cast the value to unsigned long. + + * addr2line.c (fill_lines): print error when lseek fails. + Thu Mar 3 00:36:29 2011 NARUSE, Yui <naruse@r...> * lib/rexml/encoding.rb (REXML::Encoding#encoding=): store @encoding Index: addr2line.c =================================================================== --- addr2line.c (revision 31009) +++ addr2line.c (revision 31010) @@ -85,7 +85,7 @@ for (;;) { unsigned char b = *(unsigned char *)(*p)++; if (b < 0x80) { - r += b << s; + r += (unsigned long)b << s; break; } r += (b & 0x7f) << s; @@ -442,6 +442,12 @@ return; } filesize = lseek(fd, 0, SEEK_END); + if (filesize < 0) { + int e = errno; + close(fd); + fprintf(stderr, "lseek: %s\n", strerror(e)); + return; + } lseek(fd, 0, SEEK_SET); /* async-signal unsafe */ file = (char *)mmap(NULL, filesize, PROT_READ, MAP_SHARED, fd, 0); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/