summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-03-17 19:47:45 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-03-17 19:47:45 +0900
commit3325194ac0fd9e14ab5535c80b3a9b329d030e76 (patch)
tree6d9a306c08dff618a66af0f7bf3a03900e3e04ae
parent165e4572363f964e28cfdc51fe26de6728a5c174 (diff)
Get rid of bogus warning by VC
``` c:\projects\ruby\mjit_worker.c(1219) : warning C4090: 'function' : different 'const' qualifiers ``` It seems confused by passing "pointer to pointer to const object", not "pointer to const object".
-rw-r--r--mjit_worker.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index fe2754eedf..eab7501ace 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1216,7 +1216,8 @@ mjit_capture_cc_entries(const struct rb_iseq_constant_body *compiled_iseq, const
if (cc_entries == NULL) return -1;
}
else {
- cc_entries = realloc(unit->cc_entries, sizeof(struct rb_callcache *) * new_entries_size);
+ void *cc_ptr = (void *)unit->cc_entries; // get rid of bogus warning by VC
+ cc_entries = realloc(cc_ptr, sizeof(struct rb_callcache *) * new_entries_size);
if (cc_entries == NULL) return -1;
unit->cc_entries = cc_entries;
cc_entries += cc_entries_index;