aboutsummaryrefslogtreecommitdiffstats
path: root/yjit/src/stats.rs
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-07-04 10:45:29 -0400
committerGitHub <noreply@github.com>2023-07-04 10:45:29 -0400
commit296782ab60e63fe825461a199369c5dd8505c2b7 (patch)
tree9f3375ce02af963bf860ab8718f42c8113ec5e08 /yjit/src/stats.rs
parent218f913aa6cd3bcbf715f229f400effee0f79ea6 (diff)
downloadruby-296782ab60e63fe825461a199369c5dd8505c2b7.tar.gz
YJIT: Fix autosplat miscomp for blocks with optionals (#8006)
* YJIT: Fix autosplat miscomp for blocks with optionals When passing an array as the sole argument to `yield`, and the yieldee takes more than 1 optional parameter, the array is expanded similar to `*array` splat calls. This is called "autosplat" in `setup_parameters_complex()`. Previously, YJIT did not detect this autosplat condition. It passed the array without expanding it, deviating from interpreter behavior. Detect this conditon and refuse to compile it. Fixes: Shopify/yjit#313 * RJIT: Fix autosplat miscomp for blocks with optionals This is mirrors the same issue as YJIT. See previous commit.
Diffstat (limited to 'yjit/src/stats.rs')
-rw-r--r--yjit/src/stats.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs
index 91ecc8209b..7c5b334421 100644
--- a/yjit/src/stats.rs
+++ b/yjit/src/stats.rs
@@ -296,6 +296,7 @@ make_counters! {
invokesuper_block,
invokeblock_none,
+ invokeblock_iseq_arg0_optional,
invokeblock_iseq_arg0_has_kw,
invokeblock_iseq_arg0_args_splat,
invokeblock_iseq_arg0_not_array,