[clang] bcaacf3 - [clang][Interp][NFC] Fix a user-after-move

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 18 05:16:32 PDT 2024


Author: Timm Bäder
Date: 2024-06-18T14:16:22+02:00
New Revision: bcaacf38920fe2b85e7d65e8c3832deefea96d21

URL: https://github.com/llvm/llvm-project/commit/bcaacf38920fe2b85e7d65e8c3832deefea96d21
DIFF: https://github.com/llvm/llvm-project/commit/bcaacf38920fe2b85e7d65e8c3832deefea96d21.diff

LOG: [clang][Interp][NFC] Fix a user-after-move

Reported by a static analyzer.

Added: 
    

Modified: 
    clang/lib/AST/Interp/InterpStack.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/InterpStack.h b/clang/lib/AST/Interp/InterpStack.h
index 9d85503b851be..4966e2870de6b 100644
--- a/clang/lib/AST/Interp/InterpStack.h
+++ b/clang/lib/AST/Interp/InterpStack.h
@@ -48,7 +48,6 @@ class InterpStack final {
 #endif
     T *Ptr = &peekInternal<T>();
     T Value = std::move(*Ptr);
-    Ptr->~T();
     shrink(aligned_size<T>());
     return Value;
   }


        


More information about the cfe-commits mailing list