mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 05:29:10 +02:00
ZJIT: Fix assert failure on JIT combo build
Previously, when `./configure --enable-yjit=dev --enable-zjit` JIT_DESCRIPTION was defined to be "ZJIT", but when running with `--yjit`, ruby_set_yjit_description() calls `define_ruby_description("+YJIT dev")`, which is longer than the following assertion expects: RUBY_ASSERT(n <= ruby_description_opt_point + (int)rb_strlen_lit(JIT_DESCRIPTION)); Use the concatenation of the two strings -- the contents of the string is never used. Minimize the scope of the macro, too.
This commit is contained in:
parent
fdb831fdfc
commit
b080fcd3cd
1 changed files with 3 additions and 5 deletions
|
@ -72,11 +72,6 @@ const int ruby_api_version[] = {
|
|||
#else
|
||||
#define ZJIT_DESCRIPTION " +ZJIT"
|
||||
#endif
|
||||
#if USE_ZJIT
|
||||
#define JIT_DESCRIPTION ZJIT_DESCRIPTION
|
||||
#else
|
||||
#define JIT_DESCRIPTION YJIT_DESCRIPTION
|
||||
#endif
|
||||
#if USE_MODULAR_GC
|
||||
#define GC_DESCRIPTION " +GC"
|
||||
#else
|
||||
|
@ -207,6 +202,8 @@ rb_ruby_default_parser_set(ruby_default_parser_enum parser)
|
|||
static void
|
||||
define_ruby_description(const char *const jit_opt)
|
||||
{
|
||||
#define JIT_DESCRIPTION YJIT_DESCRIPTION ZJIT_DESCRIPTION
|
||||
|
||||
static char desc[
|
||||
sizeof(ruby_description)
|
||||
+ rb_strlen_lit(JIT_DESCRIPTION)
|
||||
|
@ -248,6 +245,7 @@ define_ruby_description(const char *const jit_opt)
|
|||
* The full ruby version string, like <tt>ruby -v</tt> prints
|
||||
*/
|
||||
rb_define_const(mRuby, "DESCRIPTION", /* MKSTR(description) */ description);
|
||||
#undef JIT_DESCRIPTION
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue