forked from OSchip/llvm-project
Initialize output parameters
If the function returns true, it should set all output paremeters, similar to Output::preflightElement, or we have UB on code like: ``` void *SaveInfo; if (io.preflightFlowElement(i, SaveInfo)) io.postflightFlowElement(SaveInfo); ``` It's going to be detected by msan with: -Xclang -enable-noundef-analysis -mllvm -msan-eager-checks=1 Differential Revision: https://reviews.llvm.org/D116826
This commit is contained in:
parent
ec2945d031
commit
ee43259cbc
|
@ -629,7 +629,7 @@ void Output::endFlowSequence() {
|
|||
outputUpToEndOfLine(" ]");
|
||||
}
|
||||
|
||||
bool Output::preflightFlowElement(unsigned, void *&) {
|
||||
bool Output::preflightFlowElement(unsigned, void *&SaveInfo) {
|
||||
if (NeedFlowSequenceComma)
|
||||
output(", ");
|
||||
if (WrapColumn && Column > WrapColumn) {
|
||||
|
@ -639,6 +639,7 @@ bool Output::preflightFlowElement(unsigned, void *&) {
|
|||
Column = ColumnAtFlowStart;
|
||||
output(" ");
|
||||
}
|
||||
SaveInfo = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue