Skip to content

Commit b6718c2

Browse files
committed
lcssa: add safety to deal with block constant instructions correctly
1 parent afbbf08 commit b6718c2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/shady/passes/lcssa.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,11 @@ const Node* process_node(Context* ctx, const Node* old) {
175175
assert(false);
176176
}
177177
case Case_TAG: {
178-
Nodes nparams = recreate_variables(&ctx->rewriter, get_abstraction_params(old));
179-
register_processed_list(&ctx->rewriter, get_abstraction_params(old), nparams);
180-
return case_(a, nparams, process_abstraction_body(ctx, old, get_abstraction_body(old)));
178+
if (ctx->scope) {
179+
Nodes nparams = recreate_variables(&ctx->rewriter, get_abstraction_params(old));
180+
register_processed_list(&ctx->rewriter, get_abstraction_params(old), nparams);
181+
return case_(a, nparams, process_abstraction_body(ctx, old, get_abstraction_body(old)));
182+
}
181183
}
182184
default: break;
183185
}

0 commit comments

Comments
 (0)