Skip to content

Commit 5554b9c

Browse files
committed
fix: don't mutate src module when running passes
1 parent 13276ac commit 5554b9c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/shady/compile.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,16 @@ void add_scheduler_source(const CompilerConfig* config, Module* dst) {
8888
}
8989

9090
CompilationResult run_compiler_passes(CompilerConfig* config, Module** pmod) {
91-
if (config->dynamic_scheduling) {
92-
add_scheduler_source(config, *pmod);
93-
}
94-
9591
IrArena* initial_arena = (*pmod)->arena;
9692
Module* old_mod = NULL;
93+
94+
if (config->dynamic_scheduling) {
95+
*pmod = import(config, *pmod); // we don't want to mess with the original module
96+
97+
add_scheduler_source(config, *pmod);
98+
log_module(ERROR, config, *pmod);
99+
//exit(0);
100+
}
97101

98102
RUN_PASS(reconvergence_heuristics)
99103

0 commit comments

Comments
 (0)