diff options
Diffstat (limited to 'src/passes/Precompute.cpp')
-rw-r--r-- | src/passes/Precompute.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp index c82a880b1..bf5924720 100644 --- a/src/passes/Precompute.cpp +++ b/src/passes/Precompute.cpp @@ -168,6 +168,11 @@ struct Precompute if (curr->type.isVector()) { return; } + // Don't try to precompute a reference. We can't replace it with a constant + // expression, as that would make a copy of it by value. + if (curr->type.isRef()) { + return; + } // try to evaluate this into a const Flow flow = precomputeExpression(curr); if (flow.getType().hasVector()) { |