1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

YJIT: Add an assert to help with Context changes

While experimenting I found that it's easy to change Context and forget
to also change the copying operation in limit_block_versions(). Add an
assert to make sure we substitute a compatible generic context when
limiting the number of versions.
This commit is contained in:
Alan Wu 2022-11-01 11:44:55 -04:00
parent a70f90e1a9
commit cbf15e5cbe
Notes: git 2022-11-01 18:16:52 +00:00

View file

@ -846,7 +846,12 @@ pub fn limit_block_versions(blockid: BlockId, ctx: &Context) -> Context {
generic_ctx.stack_size = ctx.stack_size;
generic_ctx.sp_offset = ctx.sp_offset;
// Mutate the incoming context
debug_assert_ne!(
usize::MAX,
ctx.diff(&generic_ctx),
"should substitute a compatible context",
);
return generic_ctx;
}