Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ releases.

* RubyGems 4.1.0.dev
* bundler 4.1.0.dev
* prism 1.8.0
* stringio 3.2.1.dev
* strscan 3.1.7.dev

Expand Down
4 changes: 2 additions & 2 deletions error.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,14 +1383,14 @@ rb_unexpected_type(VALUE x, int t)
int
rb_typeddata_inherited_p(const rb_data_type_t *child, const rb_data_type_t *parent)
{
return rb_typeddata_inherited_p_inline(child, parent);
return rbimpl_typeddata_inherited_p_inline(child, parent);
}

#undef rb_typeddata_is_kind_of
int
rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type)
{
return rb_typeddata_is_kind_of_inline(obj, data_type);
return rbimpl_typeddata_is_kind_of_inline(obj, data_type);
}

#undef rb_typeddata_is_instance_of
Expand Down
8 changes: 4 additions & 4 deletions include/ruby/internal/core/rtypeddata.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,24 +673,24 @@ RTYPEDDATA_TYPE(VALUE obj)
RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NONNULL(())
static inline bool
rb_typeddata_inherited_p_inline(const rb_data_type_t *child, const rb_data_type_t *parent)
rbimpl_typeddata_inherited_p_inline(const rb_data_type_t *child, const rb_data_type_t *parent)
{
do {
if (RB_LIKELY(child == parent)) return true;
} while ((child = child->parent) != NULL);
return false;
}
#define rb_typeddata_inherited_p rb_typeddata_inherited_p_inline
#define rb_typeddata_inherited_p rbimpl_typeddata_inherited_p_inline

RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NONNULL((2))
static inline bool
rb_typeddata_is_kind_of_inline(VALUE obj, const rb_data_type_t *data_type)
rbimpl_typeddata_is_kind_of_inline(VALUE obj, const rb_data_type_t *data_type)
{
if (RB_UNLIKELY(!rbimpl_obj_typeddata_p(obj))) return false;
return rb_typeddata_inherited_p(RTYPEDDATA_TYPE(obj), data_type);
}
#define rb_typeddata_is_kind_of rb_typeddata_is_kind_of_inline
#define rb_typeddata_is_kind_of rbimpl_typeddata_is_kind_of_inline

RBIMPL_ATTR_ARTIFICIAL()
RBIMPL_ATTR_NONNULL((2))
Expand Down
2 changes: 1 addition & 1 deletion lib/prism/prism.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "prism"
spec.version = "1.7.0"
spec.version = "1.8.0"
spec.authors = ["Shopify"]
spec.email = ["ruby@shopify.com"]

Expand Down
2 changes: 1 addition & 1 deletion prism/extension.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PRISM_EXT_NODE_H
#define PRISM_EXT_NODE_H

#define EXPECTED_PRISM_VERSION "1.7.0"
#define EXPECTED_PRISM_VERSION "1.8.0"

#include <ruby.h>
#include <ruby/encoding.h>
Expand Down
2 changes: 1 addition & 1 deletion prism/templates/lib/prism/serialize.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Prism

# The minor version of prism that we are expecting to find in the serialized
# strings.
MINOR_VERSION = 7
MINOR_VERSION = 8

# The patch version of prism that we are expecting to find in the serialized
# strings.
Expand Down
4 changes: 2 additions & 2 deletions prism/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* The minor version of the Prism library as an int.
*/
#define PRISM_VERSION_MINOR 7
#define PRISM_VERSION_MINOR 8

/**
* The patch version of the Prism library as an int.
Expand All @@ -24,6 +24,6 @@
/**
* The version of the Prism library as a constant string.
*/
#define PRISM_VERSION "1.7.0"
#define PRISM_VERSION "1.8.0"

#endif
14 changes: 10 additions & 4 deletions regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5264,18 +5264,24 @@ set_optimize_exact_info(regex_t* reg, OptExactInfo* e)

if (e->ignore_case > 0) {
if (e->len >= 3 || (e->len >= 2 && allow_reverse)) {
int orig_len = e->len;
e->len = set_bm_skip(reg->exact, reg->exact_end, reg,
reg->map, 1);
reg->exact_end = reg->exact + e->len;
if (e->len >= 3) {
reg->exact_end = reg->exact + e->len;
reg->optimize = (allow_reverse != 0
? ONIG_OPTIMIZE_EXACT_BM_IC : ONIG_OPTIMIZE_EXACT_BM_NOT_REV_IC);
}
else if (e->len > 0) {
else {
/* Even if BM skip table can't be built (e.g., pattern starts with
's' or 'k' which have multi-byte case fold variants), we should
still use EXACT_IC optimization with the original pattern.
Without this fallback, patterns like /slackware/i have no
optimization at all, causing severe performance regression
especially with non-ASCII strings. See [Bug #21824] */
e->len = orig_len; /* Restore original length for EXACT_IC */
reg->optimize = ONIG_OPTIMIZE_EXACT_IC;
}
else
return 0;
}
else {
reg->optimize = ONIG_OPTIMIZE_EXACT_IC;
Expand Down
2 changes: 1 addition & 1 deletion tool/mk_builtin_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def generate_cexpr(ofile, lineno, line_file, body_lineno, text, locals, func_nam
next unless lvar or local_ptrs.include?(param)
f.puts "VALUE *const #{param}__ptr = (VALUE *)&ec->cfp->ep[#{-3 - i}];"
f.puts "MAYBE_UNUSED(const VALUE) #{param} = *#{param}__ptr;" if lvar
lineno += 1
lineno += lvar ? 2 : 1
}
f.puts "#line #{body_lineno} \"#{line_file}\""
lineno += 1
Expand Down
2 changes: 1 addition & 1 deletion tool/redmine-backporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def backport_command_string
next false if c.match(/\A\d{1,6}\z/) # skip SVN revision

# check if the Git revision is included in master
has_commit(c, "master")
has_commit(c, "origin/master")
end.sort_by do |changeset|
Integer(IO.popen(%W[git show -s --format=%ct #{changeset}], &:read))
end
Expand Down