Skip to content

Commit 4b454af

Browse files
authored
Convert unreachable return statement into llvm_unreachable (#129627)
Static analysis flags the final return statement in `ReadExtensionBlock` as unreachable and indeed it is since there is no way to exit the `while(true)` loop besides a *return statement*. So I am converting it into a `llvm_unreachable` to explicitly document this.
1 parent b5e70d0 commit 4b454af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Serialization/ASTReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5329,7 +5329,7 @@ llvm::Error ASTReader::ReadExtensionBlock(ModuleFile &F) {
53295329
}
53305330
}
53315331

5332-
return llvm::Error::success();
5332+
llvm_unreachable("ReadExtensionBlock should return from while loop");
53335333
}
53345334

53355335
void ASTReader::InitializeContext() {

0 commit comments

Comments
 (0)