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

ruby-changes:43656

From: nobu <ko1@a...>
Date: Fri, 22 Jul 2016 19:55:27 +0900 (JST)
Subject: [ruby-changes:43656] nobu:r55729 (trunk): Fix Issues reported by PVS-Studio static analyzer

nobu	2016-07-22 19:55:22 +0900 (Fri, 22 Jul 2016)

  New Revision: 55729

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55729

  Log:
    Fix Issues reported by PVS-Studio static analyzer
    
    * vm.c (vm_set_main_stack): remove unnecessary check.  toplevel
      binding must be initialized.  [Bug #12611] (N1)
    * win32/win32.c (w32_symlink): fix return type.  [Bug #12611] (N3)
    * string.c (rb_str_split_m): simplify the condition.
      [Bug #12611](N4)

  Modified files:
    trunk/ChangeLog
    trunk/string.c
    trunk/vm.c
    trunk/win32/win32.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55728)
+++ ChangeLog	(revision 55729)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jul 22 19:55:20 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* vm.c (vm_set_main_stack): remove unnecessary check.  toplevel
+	  binding must be initialized.  [Bug #12611] (N1)
+
+	* win32/win32.c (w32_symlink): fix return type.  [Bug #12611] (N3)
+
+	* string.c (rb_str_split_m): simplify the condition.
+	  [Bug #12611](N4)
+
 Fri Jul 22 17:13:37 2016  Martin Duerst  <duerst@i...>
 
 	* string.c (String#dump): Change escaping of non-ASCII characters in
Index: vm.c
===================================================================
--- vm.c	(revision 55728)
+++ vm.c	(revision 55729)
@@ -379,7 +379,7 @@ vm_set_main_stack(rb_thread_t *th, const https://github.com/ruby/ruby/blob/trunk/vm.c#L379
     vm_set_eval_stack(th, iseq, 0, &env->block);
 
     /* save binding */
-    if (bind && iseq->body->local_size > 0) {
+    if (iseq->body->local_size > 0) {
 	bind->env = vm_make_env_object(th, th->cfp);
     }
 }
Index: string.c
===================================================================
--- string.c	(revision 55728)
+++ string.c	(revision 55729)
@@ -7235,7 +7235,7 @@ rb_str_split_m(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/string.c#L7235
 		    beg = start;
 		}
 		else {
-                    if (ptr+start == ptr+len)
+                    if (start == len)
                         start++;
                     else
                         start += rb_enc_fast_mbclen(ptr+start,ptr+len,enc);
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 55728)
+++ win32/win32.c	(revision 55729)
@@ -4947,7 +4947,7 @@ w32_symlink(UINT cp, const char *src, co https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L4947
     DWORD flag = 0;
     BOOLEAN ret;
 
-    typedef DWORD (WINAPI *create_symbolic_link_func)(WCHAR*, WCHAR*, DWORD);
+    typedef BOOLEAN (WINAPI *create_symbolic_link_func)(WCHAR*, WCHAR*, DWORD);
     static create_symbolic_link_func create_symbolic_link =
 	(create_symbolic_link_func)-1;
 

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

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