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

ruby-changes:64354

From: Nobuyoshi <ko1@a...>
Date: Sun, 20 Dec 2020 03:17:08 +0900 (JST)
Subject: [ruby-changes:64354] c01ad11f90 (master): bigdecimal: initialize conditionally assigned variable

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

From c01ad11f908c2a57c2348e83d109b08fdd89dc4e Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 20 Dec 2020 03:13:33 +0900
Subject: bigdecimal: initialize conditionally assigned variable


diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 4e49de8..7fdf401 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -418,7 +418,7 @@ BigDecimal_precision(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L418
      */
 
     ssize_t ex = p->exponent;
-    ssize_t precision;
+    ssize_t precision = 0;
     if (ex < 0) {
         precision = (-ex + 1) * BASE_FIG;  /* 1 is for p->frac[0] */
         ex = 0;
-- 
cgit v0.10.2


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

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