Skip to content

Commit

Permalink
demote_alloca: fix crashes with free-standing blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugobros3 committed Feb 2, 2024
1 parent 7f13050 commit 40e45cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/shady/passes/opt_demote_alloca.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ static const Node* process(Context* ctx, const Node* old) {
destroy_uses_map(fun_ctx.scope_uses);
return fun;
}
case Constant_TAG: {
Context fun_ctx = *ctx;
fun_ctx.scope_uses = NULL;
return recreate_node_identity(&fun_ctx.rewriter, old);
}
case Let_TAG: {
const Node* oinstruction = get_let_instruction(old);
const Node* otail = get_let_tail(old);
Expand Down

0 comments on commit 40e45cb

Please sign in to comment.