From a343f6609e5accfd20c5a6c66df63d62d759520e Mon Sep 17 00:00:00 2001 From: ktsj Date: Sun, 15 Jul 2018 11:42:15 +0000 Subject: [PATCH] vm_core.h, vm_dump.c: fix cast Revert r63968 and cast at caller side to prevent unintentional casting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 2 +- vm_dump.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vm_core.h b/vm_core.h index 3ec0c10107..73ef51da49 100644 --- a/vm_core.h +++ b/vm_core.h @@ -1062,7 +1062,7 @@ typedef rb_control_frame_t * (FUNC_FASTCALL(*rb_insn_func_t))(rb_execution_context_t *, rb_control_frame_t *); #define VM_TAGGED_PTR_SET(p, tag) ((VALUE)(p) | (tag)) -#define VM_TAGGED_PTR_REF(v, mask) ((void *)((VALUE)(v) & ~mask)) +#define VM_TAGGED_PTR_REF(v, mask) ((void *)((v) & ~mask)) #define GC_GUARDED_PTR(p) VM_TAGGED_PTR_SET((p), 0x01) #define GC_GUARDED_PTR_REF(p) VM_TAGGED_PTR_REF((p), 0x03) diff --git a/vm_dump.c b/vm_dump.c index 31d08be50d..348582b934 100644 --- a/vm_dump.c +++ b/vm_dump.c @@ -151,7 +151,7 @@ rb_vmdebug_stack_dump_raw(const rb_execution_context_t *ec, const rb_control_fra t = (VALUE *)*p; if (ec->vm_stack <= t && t < sp) { - fprintf(stderr, " (= %ld)", (long)((VALUE *)GC_GUARDED_PTR_REF(t) - ec->vm_stack)); + fprintf(stderr, " (= %ld)", (long)((VALUE *)GC_GUARDED_PTR_REF((VALUE)t) - ec->vm_stack)); } if (p == ep)