diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-08-15 12:59:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-15 16:59:30 +0000 |
| commit | 2d66ef717df0e10946aa583fa32b360766485fed (patch) | |
| tree | f678929bb227181525cf6fa181c69106003710c5 | |
| parent | 33bffde92339ee82cb7ed57108206bd9e2a64139 (diff) | |
Show anonymous and ambiguous params in ISeq disassembly
Previously, in the disasesmbly for ISeqs, there's no way to know if the
anon_rest, anon_kwrest, or ambiguous_param0 flags are set. This commit
extends the names of the rest, kwrest, and lead params to display this
information. They are relevant for the ISeqs' runtime behavior.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11237
Merged-By: XrXr
| -rw-r--r-- | iseq.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2735,11 +2735,11 @@ rb_iseq_disasm_recursive(const rb_iseq_t *iseq, VALUE indent) } snprintf(argi, sizeof(argi), "%s%s%s%s%s%s", /* arg, opts, rest, post, kwrest, block */ - body->param.lead_num > li ? "Arg" : "", + (body->param.lead_num > li) ? (body->param.flags.ambiguous_param0 ? "AmbiguousArg" : "Arg") : "", opti, - (body->param.flags.has_rest && body->param.rest_start == li) ? "Rest" : "", + (body->param.flags.has_rest && body->param.rest_start == li) ? (body->param.flags.anon_rest ? "AnonRest" : "Rest") : "", (body->param.flags.has_post && body->param.post_start <= li && li < body->param.post_start + body->param.post_num) ? "Post" : "", - (body->param.flags.has_kwrest && keyword->rest_start == li) ? "Kwrest" : "", + (body->param.flags.has_kwrest && keyword->rest_start == li) ? (body->param.flags.anon_kwrest ? "AnonKwrest" : "Kwrest") : "", (body->param.flags.has_block && body->param.block_start == li) ? "Block" : ""); rb_str_cat(str, indent_str, indent_len); |
