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

ruby-changes:70859

From: Nobuyoshi <ko1@a...>
Date: Fri, 14 Jan 2022 13:46:35 +0900 (JST)
Subject: [ruby-changes:70859] 9fa9cf4006 (master): Suppress possible loss of data warnings

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

From 9fa9cf4006b2278ee3de3aa75ab0697c4c119744 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 14 Jan 2022 00:41:22 +0900
Subject: Suppress possible loss of data warnings

---
 include/ruby/internal/core/rstring.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/ruby/internal/core/rstring.h b/include/ruby/internal/core/rstring.h
index 9f6dc845379..e394ab7dca0 100644
--- a/include/ruby/internal/core/rstring.h
+++ b/include/ruby/internal/core/rstring.h
@@ -426,13 +426,14 @@ RSTRING_EMBED_LEN(VALUE str) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/core/rstring.h#L426
     RBIMPL_ASSERT_OR_ASSUME(! RB_FL_ANY_RAW(str, RSTRING_NOEMBED));
 
 #if USE_RVARGC
-    short f = RSTRING(str)->as.embed.len;
+    long f = RSTRING(str)->as.embed.len;
+    return f;
 #else
     VALUE f = RBASIC(str)->flags;
     f &= RSTRING_EMBED_LEN_MASK;
     f >>= RSTRING_EMBED_LEN_SHIFT;
-#endif
     return RBIMPL_CAST((long)f);
+#endif
 }
 
 RBIMPL_WARNING_PUSH()
-- 
cgit v1.2.1


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

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