1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

compile.c: explicit address

* compile.c (prepare_compile_error): add & to explicit address of
  functions to suppress warnings by old VC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-03-26 01:34:35 +00:00
parent 08b08c1f27
commit 3f519a7bfa
2 changed files with 7 additions and 7 deletions

View file

@ -330,13 +330,13 @@ static compile_error_func
prepare_compile_error(rb_iseq_t *iseq) prepare_compile_error(rb_iseq_t *iseq)
{ {
VALUE err_info = ISEQ_COMPILE_DATA(iseq)->err_info; VALUE err_info = ISEQ_COMPILE_DATA(iseq)->err_info;
if (compile_debug) return rb_compile_bug_str; if (compile_debug) return &rb_compile_bug_str;
if (NIL_P(err_info)) { if (NIL_P(err_info)) {
err_info = rb_exc_new_cstr(rb_eSyntaxError, ""); err_info = rb_exc_new_cstr(rb_eSyntaxError, "");
RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, err_info); RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->err_info, err_info);
} }
rb_set_errinfo(err_info); rb_set_errinfo(err_info);
return append_compile_error; return &append_compile_error;
} }
#define COMPILE_ERROR prepare_compile_error(iseq) #define COMPILE_ERROR prepare_compile_error(iseq)

View file

@ -40,10 +40,10 @@ static inline vm_call_handler
vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, const int local_size) vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, const int local_size)
{ {
if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) { if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
return vm_call_iseq_setup_tailcall_0start; return &vm_call_iseq_setup_tailcall_0start;
} }
else if (0) { /* to disable optimize */ else if (0) { /* to disable optimize */
return vm_call_iseq_setup_normal_0start; return &vm_call_iseq_setup_normal_0start;
} }
else { else {
if (param_size <= #{P.end} && if (param_size <= #{P.end} &&
@ -51,7 +51,7 @@ vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, con
VM_ASSERT(local_size != 0); VM_ASSERT(local_size != 0);
return vm_call_iseq_handlers[param_size][local_size-1]; return vm_call_iseq_handlers[param_size][local_size-1];
} }
return vm_call_iseq_setup_normal_0start; return &vm_call_iseq_setup_normal_0start;
} }
} }
@ -62,10 +62,10 @@ static inline vm_call_handler
vm_call_iseq_setup_func(const struct rb_call_info *ci, struct rb_call_cache *cc) vm_call_iseq_setup_func(const struct rb_call_info *ci, struct rb_call_cache *cc)
{ {
if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) { if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
return vm_call_iseq_setup_tailcall_0start; return &vm_call_iseq_setup_tailcall_0start;
} }
else { else {
return vm_call_iseq_setup_normal_0start; return &vm_call_iseq_setup_normal_0start;
} }
} }
#endif #endif