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

ruby-changes:56527

From: Yusuke <ko1@a...>
Date: Mon, 15 Jul 2019 08:46:04 +0900 (JST)
Subject: [ruby-changes:56527] Yusuke Endoh: a197579073 (master): addr2line.c: clarify the type of integer expression

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

From a1975790731e1e9081e41e05b43516065b7d950a Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Mon, 15 Jul 2019 08:36:57 +0900
Subject: addr2line.c: clarify the type of integer expression

to suppress Coverity Scan warning.
This expression converted uint8_t to int, and then int to unsigned long.
Now it directly converts uint8_t to unsigned long.

diff --git a/addr2line.c b/addr2line.c
index f6befce..9e7df4e 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -432,7 +432,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line, https://github.com/ruby/ruby/blob/trunk/addr2line.c#L432
 	    /*basic_block = 1; */
 	    break;
 	case DW_LNS_const_add_pc:
-	    a = ((255 - header.opcode_base) / header.line_range) *
+	    a = ((255UL - header.opcode_base) / header.line_range) *
 		header.minimum_instruction_length;
 	    addr += a;
 	    break;
-- 
cgit v0.10.2


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

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