Skip to content

Commit 55ff96a

Browse files
authored
[X86][Test] Reorder PassMgrF and OS. (#134481)
Reordering `OS` and `PassMgrF` should fix the asan failure that's caused by OS being destroyed before `PassMgrF` deletes the AsmPrinter. As shown in[ this asan run ](https://lab.llvm.org/buildbot/#/builders/52/builds/7340/steps/12/logs/stdio) ``` This frame has 15 object(s): [32, 48) 'PassMgrF' (line 154) [64, 1112) 'Buf' (line 155) [1248, 1304) 'OS' (line 156) <== Memory access at offset 1280 is inside this variable ``` which indicates an ordering problem. This should help to fix all the sanitizer failures caused by the test `X86MCInstLowerTest.cpp` that's introduced by [this PR](#133352 (comment)).
1 parent 7833107 commit 55ff96a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/unittests/CodeGen/X86MCInstLowerTest.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,10 @@ TEST_F(X86MCInstLowerTest, moExternalSymbol_MCSYMBOL) {
151151
MachineModuleInfoWrapperPass *MMIWP =
152152
new MachineModuleInfoWrapperPass(TM.get(), &*MCFoo);
153153

154-
legacy::PassManager PassMgrF;
155154
SmallString<1024> Buf;
156155
llvm::raw_svector_ostream OS(Buf);
156+
legacy::PassManager PassMgrF;
157+
157158
AsmPrinter *Printer =
158159
addPassesToEmitFile(PassMgrF, OS, CodeGenFileType::AssemblyFile, MMIWP);
159160
PassMgrF.run(*M);

0 commit comments

Comments
 (0)