Skip to content

Commit 7d88d72

Browse files
committed
Add information to SILVerifier stack nesting diagnostic.
1 parent 8991192 commit 7d88d72

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5025,8 +5025,11 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
50255025
SILValue op = i.getOperand(0);
50265026
require(!state.Stack.empty(),
50275027
"stack dealloc with empty stack");
5028-
require(op == state.Stack.back(),
5029-
"stack dealloc does not match most recent stack alloc");
5028+
if (op != state.Stack.back()) {
5029+
llvm::errs() << "Recent stack alloc: " << *state.Stack.back();
5030+
require(op == state.Stack.back(),
5031+
"stack dealloc does not match most recent stack alloc");
5032+
}
50305033
state.Stack.pop_back();
50315034

50325035
} else if (isa<BeginAccessInst>(i) || isa<BeginApplyInst>(i)) {

0 commit comments

Comments
 (0)