Fix incorrect "kill" logic in copy propagation #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
考虑上面的代码如果在对
n = 3
进行复写传播时只是简单的只将b = n
杀死的话那么在对return a
进行覆写传播时就会复用本应该被杀死的语句a = b
(先前已被复写传播简化为a = n)导致return a
中的a会被替换为字面量3这明显是错误的,所以我们在这里保守的杀死一个联通分量中的所有语句。修改前产生的中间代码(错误的):
修改后产生的中间代码: