mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
proc.c: suppress a warning
* proc.c (call_method_data_safe): suppress clobbered warning by old gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
deca1d8007
commit
5c19519e8c
1 changed files with 9 additions and 1 deletions
10
proc.c
10
proc.c
|
@ -18,6 +18,12 @@
|
|||
* versions */
|
||||
#define PROC_NEW_REQUIRES_BLOCK 0
|
||||
|
||||
#if !defined(__GNUC__) || __GNUC__ < 5
|
||||
# define NO_CLOBBERED(v) (*(volatile VALUE *)&(v))
|
||||
#else
|
||||
# define NO_CLOBBERED(v) (v)
|
||||
#endif
|
||||
|
||||
const rb_cref_t *rb_vm_cref_in_context(VALUE self, VALUE cbase);
|
||||
|
||||
struct METHOD {
|
||||
|
@ -1980,7 +1986,9 @@ call_method_data_safe(rb_thread_t *th, const struct METHOD *data,
|
|||
|
||||
TH_PUSH_TAG(th);
|
||||
if ((state = TH_EXEC_TAG()) == 0) {
|
||||
result = call_method_data(th, data, argc, argv, pass_procval);
|
||||
/* result is used only if state == 0, no exceptions is caught. */
|
||||
/* otherwise it doesn't matter even if clobbered. */
|
||||
NO_CLOBBERED(result) = call_method_data(th, data, argc, argv, pass_procval);
|
||||
}
|
||||
TH_POP_TAG();
|
||||
rb_set_safe_level_force(safe);
|
||||
|
|
Loading…
Add table
Reference in a new issue