From 2d66ef717df0e10946aa583fa32b360766485fed Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 15 Aug 2024 12:59:30 -0400 Subject: 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. --- iseq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iseq.c b/iseq.c index 82508ddb24..c6a521b0bd 100644 --- a/iseq.c +++ b/iseq.c @@ -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); -- cgit v1.2.3