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

ruby-changes:56564

From: Yusuke <ko1@a...>
Date: Tue, 16 Jul 2019 07:19:58 +0900 (JST)
Subject: [ruby-changes:56564] Yusuke Endoh: c184a1c261 (master): compile.c: add NO_CHECK for the calls to COMPILE whose result is unused

https://git.ruby-lang.org/ruby.git/commit/?id=c184a1c261

From c184a1c261209da403db553eef7f7353f7ee5edd Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Tue, 16 Jul 2019 07:18:54 +0900
Subject: compile.c: add NO_CHECK for the calls to COMPILE whose result is
 unused

to suppress many warnings of Coverity Scan

diff --git a/compile.c b/compile.c
index e553473..8a098c7 100644
--- a/compile.c
+++ b/compile.c
@@ -1710,7 +1710,7 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const NODE *cons https://github.com/ruby/ruby/blob/trunk/compile.c#L1710
 	body->param.size = arg_size;
 
 	if (args->pre_init) { /* m_init */
-	    COMPILE_POPPED(optargs, "init arguments (m)", args->pre_init);
+	    NO_CHECK(COMPILE_POPPED(optargs, "init arguments (m)", args->pre_init));
 	}
 	if (args->post_init) { /* p_init */
             NO_CHECK(COMPILE_POPPED(optargs, "init arguments (p)", args->post_init));
@@ -3961,7 +3961,7 @@ compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node_ro https://github.com/ruby/ruby/blob/trunk/compile.c#L3961
 		    opt_p = 0;
 		}
 
-                COMPILE_(anchor, "array element", node->nd_head, popped);
+                NO_CHECK(COMPILE_(anchor, "array element", node->nd_head, popped));
 	    }
 
             if (opt_p) {
@@ -4931,7 +4931,7 @@ compile_named_capture_assign(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE https://github.com/ruby/ruby/blob/trunk/compile.c#L4931
     ADD_INSN(ret, line, pop);
     for (vars = node; vars; vars = vars->nd_next) {
 	last = ret->last;
-	COMPILE_POPPED(ret, "capture", vars->nd_head);
+	NO_CHECK(COMPILE_POPPED(ret, "capture", vars->nd_head));
 	last = last->next; /* putobject :var */
 	((INSN*)last)->insn_id = BIN(putnil);
 	((INSN*)last)->operand_size = 0;
-- 
cgit v0.10.2


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

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