Skip to content

Commit 584c47c

Browse files
fix: fix Code.cse for different symbolic types
1 parent 0a08221 commit 584c47c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/code.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,9 @@ function topological_sort(graph)
722722
end
723723
if iscall(node)
724724
args = map(dfs, arguments(node))
725-
new_node = maketerm(typeof(node), operation(node), args, metadata(node))
725+
# use `term` instead of `maketerm` because we only care about the operation being performed
726+
# and not the representation. This avoids issues with `newsym` symbols not having sizes, etc.
727+
new_node = term(operation(node), args...)
726728
sym = newsym(symtype(new_node))
727729
push!(sorted_nodes, sym new_node)
728730
visited[node] = sym

0 commit comments

Comments
 (0)