mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vm_eval.c: eval_string_protect wrapper
* vm_eval.c (eval_string_protect): cast data instead of the function pointer, to suppress "cast between incompatible function types" warning by gcc 8.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
841d5ae80e
commit
b755fe889a
1 changed files with 7 additions and 1 deletions
|
@ -1433,6 +1433,12 @@ rb_eval_string(const char *str)
|
||||||
return ruby_eval_string_from_file(str, "eval");
|
return ruby_eval_string_from_file(str, "eval");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
eval_string_protect(VALUE str)
|
||||||
|
{
|
||||||
|
return rb_eval_string((char *)str);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Evaluates the given string in an isolated binding.
|
* Evaluates the given string in an isolated binding.
|
||||||
*
|
*
|
||||||
|
@ -1446,7 +1452,7 @@ rb_eval_string(const char *str)
|
||||||
VALUE
|
VALUE
|
||||||
rb_eval_string_protect(const char *str, int *pstate)
|
rb_eval_string_protect(const char *str, int *pstate)
|
||||||
{
|
{
|
||||||
return rb_protect((VALUE (*)(VALUE))rb_eval_string, (VALUE)str, pstate);
|
return rb_protect(eval_string_protect, (VALUE)str, pstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue