Verify layouts of extracted specialization symbols

This commit is contained in:
Ayaz Hafiz 2022-05-05 11:46:29 -04:00
parent 8228df55c7
commit 674ec3beae
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 131 additions and 23 deletions

View file

@ -1210,8 +1210,15 @@ pub fn optimize_when<'a>(
// bind the fields referenced in the pattern. For guards this happens separately, so
// the pattern variables are defined when evaluating the guard.
if !has_guard {
branch =
crate::ir::store_pattern(env, procs, layout_cache, &pattern, cond_symbol, branch);
branch = crate::ir::store_pattern(
env,
procs,
layout_cache,
&pattern,
cond_layout,
cond_symbol,
branch,
);
}
let ((branch_index, choice), opt_jump) = create_choices(&target_counts, index, branch);
@ -1723,7 +1730,15 @@ fn decide_to_branching<'a>(
body: arena.alloc(decide),
};
crate::ir::store_pattern(env, procs, layout_cache, &pattern, cond_symbol, join)
crate::ir::store_pattern(
env,
procs,
layout_cache,
&pattern,
cond_layout,
cond_symbol,
join,
)
}
Chain {
test_chain,