mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
llvm-diff: Avoid crash with complex expressions
Summary: With complex IR, the difference engine can enter an inconsistent state where the instruction and block difference engines return different results. Prevent a crash by refusing to pop beyond the end of the vector. Reviewers: rjmccall Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D80351
This commit is contained in:
parent
4ee52612b3
commit
69d36b0ea5
@ -577,7 +577,7 @@ void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart,
|
|||||||
DiffLogBuilder Diff(Engine.getConsumer());
|
DiffLogBuilder Diff(Engine.getConsumer());
|
||||||
|
|
||||||
// Drop trailing matches.
|
// Drop trailing matches.
|
||||||
while (Path.back() == DC_match)
|
while (Path.size() && Path.back() == DC_match)
|
||||||
Path.pop_back();
|
Path.pop_back();
|
||||||
|
|
||||||
// Skip leading matches.
|
// Skip leading matches.
|
||||||
|
Loading…
Reference in New Issue
Block a user