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
2 changes: 1 addition & 1 deletion compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -11762,7 +11762,7 @@ insn_data_to_s_detail(INSN *iobj)
{
const struct rb_callinfo *ci = (struct rb_callinfo *)OPERAND_AT(iobj, j);
rb_str_cat2(str, "<calldata:");
if (vm_ci_mid(ci)) rb_str_catf(str, "%"PRIsVALUE, rb_id2str(vm_ci_mid(ci)));
if (vm_ci_mid(ci)) rb_str_append(str, rb_id2str(vm_ci_mid(ci)));
rb_str_catf(str, ", %d>", vm_ci_argc(ci));
break;
}
Expand Down
3 changes: 1 addition & 2 deletions ext/socket/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,7 @@ wait_connectable(VALUE self, VALUE timeout, const struct sockaddr *sockaddr, int
if (result == Qfalse) {
VALUE rai = rsock_addrinfo_new((struct sockaddr *)sockaddr, len, PF_UNSPEC, 0, 0, Qnil, Qnil);
VALUE addr_str = rsock_addrinfo_inspect_sockaddr(rai);
VALUE message = rb_sprintf("user specified timeout for %" PRIsVALUE, addr_str);
rb_raise(rb_eIOTimeoutError, "%" PRIsVALUE, message);
rb_raise(rb_eIOTimeoutError, "user specified timeout for %" PRIsVALUE, addr_str);
}

int revents = RB_NUM2INT(result);
Expand Down
2 changes: 1 addition & 1 deletion ext/socket/ipsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ rsock_raise_user_specified_timeout(struct addrinfo *ai, VALUE host, VALUE port)
message = rb_sprintf("user specified timeout for %" PRIsVALUE " port %" PRIsVALUE, host, port);
}

rb_raise(rb_eIOTimeoutError, "%" PRIsVALUE, message);
rb_exc_raise(rb_exc_new_str(rb_eIOTimeoutError, message));
}

static VALUE
Expand Down
2 changes: 1 addition & 1 deletion gems/bundled_gems
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ net-imap 0.6.4 https://github.com/ruby/net-imap
net-smtp 0.5.1 https://github.com/ruby/net-smtp
matrix 0.4.3 https://github.com/ruby/matrix
prime 0.1.4 https://github.com/ruby/prime
rbs 4.0.2 https://github.com/ruby/rbs 36a7e8e38df9efd33db83c3f30f0308bdeb84bd9
rbs 4.0.2 https://github.com/ruby/rbs 1582ce76429810b057a2816e5000cf5de4b1363d
typeprof 0.32.0 https://github.com/ruby/typeprof
debug 1.11.1 https://github.com/ruby/debug 9dc2024a5a05116b3d38afbc5579d9503d8913f3
racc 1.8.1 https://github.com/ruby/racc
Expand Down
52 changes: 22 additions & 30 deletions proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3319,6 +3319,18 @@ rb_method_parameters(VALUE method)
return method_def_parameters(rb_method_def(method));
}

static inline VALUE
append_param_name(VALUE str, VALUE name, const char *unnamed)
{
if (!NIL_P(name)) {
rb_str_append(str, rb_sym2str(name));
}
else if (unnamed) {
rb_str_cat_cstr(str, unnamed);
}
return str;
}

/*
* call-seq:
* meth.to_s -> string
Expand Down Expand Up @@ -3467,50 +3479,30 @@ method_inspect(VALUE method)
name = RARRAY_AREF(pair, 1);
}
else {
// FIXME: can it be reduced to switch/case?
if (kind == req || kind == opt) {
name = rb_str_new2("_");
}
else if (kind == rest || kind == keyrest) {
name = rb_str_new2("");
}
else if (kind == block) {
name = rb_str_new2("block");
}
else if (kind == nokey) {
name = rb_str_new2("nil");
}
else if (kind == noblock) {
name = rb_str_new2("nil");
}
else {
name = Qnil;
}
name = Qnil;
}

if (kind == req) {
rb_str_catf(str, "%"PRIsVALUE, name);
append_param_name(str, name, "_");
}
else if (kind == opt) {
rb_str_catf(str, "%"PRIsVALUE"=...", name);
rb_str_cat_cstr(append_param_name(str, name, "_"), "=...");
}
else if (kind == keyreq) {
rb_str_catf(str, "%"PRIsVALUE":", name);
rb_str_cat_cstr(append_param_name(str, name, NULL), ":");
}
else if (kind == key) {
rb_str_catf(str, "%"PRIsVALUE": ...", name);
rb_str_cat_cstr(append_param_name(str, name, NULL), ": ...");
}
else if (kind == rest) {
if (name == ID2SYM('*')) {
rb_str_cat_cstr(str, forwarding ? "..." : "*");
}
else {
rb_str_catf(str, "*%"PRIsVALUE, name);
rb_str_cat_cstr(str, forwarding ? "..." : "*");
if (name != ID2SYM('*')) {
append_param_name(str, name, NULL);
}
}
else if (kind == keyrest) {
if (name != ID2SYM(idPow)) {
rb_str_catf(str, "**%"PRIsVALUE, name);
append_param_name(rb_str_cat_cstr(str, "**"), name, NULL);
}
else if (i > 0) {
rb_str_set_len(str, RSTRING_LEN(str) - 2);
Expand All @@ -3529,7 +3521,7 @@ method_inspect(VALUE method)
}
}
else {
rb_str_catf(str, "&%"PRIsVALUE, name);
append_param_name(rb_str_cat_cstr(str, "&"), name, NULL);
}
}
else if (kind == nokey) {
Expand Down