diff options
Diffstat (limited to 'src/passes/OptimizeInstructions.cpp')
-rw-r--r-- | src/passes/OptimizeInstructions.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp index 059ef28fb..3de7b6519 100644 --- a/src/passes/OptimizeInstructions.cpp +++ b/src/passes/OptimizeInstructions.cpp @@ -2040,6 +2040,12 @@ struct OptimizeInstructions return; } + if (curr->op == ExternExternalize || curr->op == ExternInternalize) { + // We can't optimize these. Even removing a non-null cast is not valid as + // they allow nulls to filter through, unlike other RefAs* + return; + } + skipNonNullCast(curr->value); // Check if the type is the kind we are checking for. |