File tree Expand file tree Collapse file tree
llvm/lib/Transforms/Instrumentation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ bool ThreadSanitizer::sanitizeFunction(
661661
662662 // /////////////////////////////////////////////////////////////////////////////
663663 // List of instructions (function calls) to delete
664- SmallVector<CallInst*, 8 > EnableDisableFuncToDelete ;
664+ SmallVector<CallInst*, 8 > EnableDisableFuncCleanupList ;
665665
666666 // Counter for considering nesting __tsan_disable/__tsan_enable
667667 int disableEnableNesting = 0 ;
@@ -682,11 +682,12 @@ bool ThreadSanitizer::sanitizeFunction(
682682 // errs() << "CalledFunc: " << CalledFunc->getName() << "\n";
683683 if (CalledFunc->getName () == " __tsan_disable" ) {
684684 disableEnableNesting++;
685- EnableDisableFuncToDelete .push_back (CI);
685+ EnableDisableFuncCleanupList .push_back (CI);
686686 continue ;
687- } else if (CalledFunc->getName () == " __tsan_enable" ) {
687+ }
688+ if (CalledFunc->getName () == " __tsan_enable" ) {
688689 disableEnableNesting--;
689- EnableDisableFuncToDelete .push_back (CI);
690+ EnableDisableFuncCleanupList .push_back (CI);
690691 continue ;
691692 }
692693 }
@@ -741,7 +742,7 @@ bool ThreadSanitizer::sanitizeFunction(
741742 */
742743
743744 // Erase all __tsan_disable/enable functions
744- for (auto *CI: EnableDisableFuncToDelete )
745+ for (auto *CI: EnableDisableFuncCleanupList )
745746 CI->eraseFromParent ();
746747 // ////////////////////////////////////////////////////////////////////////////
747748
You can’t perform that action at this time.
0 commit comments