diff options
Diffstat (limited to 'include/ruby/internal')
| -rw-r--r-- | include/ruby/internal/core/rbasic.h | 3 | ||||
| -rw-r--r-- | include/ruby/internal/core/rstring.h | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/include/ruby/internal/core/rbasic.h b/include/ruby/internal/core/rbasic.h index 35af03f7c8..63cdff8e09 100644 --- a/include/ruby/internal/core/rbasic.h +++ b/include/ruby/internal/core/rbasic.h @@ -115,6 +115,9 @@ RBasic { #endif { } +# define RBASIC_INIT RBasic() +#else +# define RBASIC_INIT {RBIMPL_VALUE_NULL} #endif }; diff --git a/include/ruby/internal/core/rstring.h b/include/ruby/internal/core/rstring.h index 0bca74e688..9cf9daa97c 100644 --- a/include/ruby/internal/core/rstring.h +++ b/include/ruby/internal/core/rstring.h @@ -395,7 +395,7 @@ rbimpl_rstring_getmem(VALUE str) } else { /* Expecting compilers to optimize this on-stack struct away. */ - struct RString retval; + struct RString retval = {RBASIC_INIT}; retval.len = RSTRING_LEN(str); retval.as.heap.ptr = RSTRING(str)->as.embed.ary; return retval; |
