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

ruby-changes:61884

From: Nobuyoshi <ko1@a...>
Date: Mon, 22 Jun 2020 06:20:05 +0900 (JST)
Subject: [ruby-changes:61884] 54ad2bd6d0 (master): Use canary cond also if not VM_CHECK_MODE to suppress warnings

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

From 54ad2bd6d09b8a04baef60dde2998bd40e73db36 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 22 Jun 2020 06:17:12 +0900
Subject: Use canary cond also if not VM_CHECK_MODE to suppress warnings


diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 702c3b7..936778f 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -158,8 +158,8 @@ CC_SET_FASTPATH(const struct rb_callcache *cc, vm_call_handler func, bool enable https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.h#L158
         } \
     }
 #else
-#define SETUP_CANARY(cond)       /* void */
-#define CHECK_CANARY(cond, insn) /* void */
+#define SETUP_CANARY(cond)       if (cond) {} else {}
+#define CHECK_CANARY(cond, insn) if (cond) {(void)(insn);}
 #endif
 
 /**********************************************************/
-- 
cgit v0.10.2


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

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