Jelajahi Sumber

Fix SAL annotations in CustomHeap::FillDebugBreak

Meghana Gupta 9 tahun lalu
induk
melakukan
1ae0a329e4

+ 1 - 1
lib/Backend/InterpreterThunkEmitter.cpp

@@ -686,7 +686,7 @@ void InterpreterThunkEmitter::EncodeInterpreterThunk(
 
 
 inline /*static*/
-DWORD InterpreterThunkEmitter::FillDebugBreak(_In_ BYTE* dest, _In_ DWORD count)
+DWORD InterpreterThunkEmitter::FillDebugBreak(_Out_writes_bytes_all_(count) BYTE* dest, _In_ DWORD count)
 {
 #if defined(_M_ARM)
     Assert(count % 2 == 0);

+ 1 - 1
lib/Backend/InterpreterThunkEmitter.h

@@ -113,7 +113,7 @@ private:
 #endif
 
     /*-------static helpers ---------*/
-    inline static DWORD FillDebugBreak(_In_ BYTE* dest, _In_ DWORD count);
+    inline static DWORD FillDebugBreak(_Out_writes_bytes_all_(count) BYTE* dest, _In_ DWORD count);
     inline static DWORD CopyWithAlignment(_Out_writes_bytes_all_(sizeInBytes) BYTE* dest, _In_ const DWORD sizeInBytes, _In_reads_bytes_(srcSize) const BYTE* src, _In_ const DWORD srcSize, _In_ const DWORD alignment);
     template<class T>
     inline static void Emit(__in_bcount(sizeof(T) + offset) BYTE* dest, __in const DWORD offset, __in const T value)

+ 1 - 1
lib/Common/Memory/CustomHeap.cpp

@@ -1108,7 +1108,7 @@ inline BucketId GetBucketForSize(size_t bytes)
 // Fills the specified buffer with "debug break" instruction encoding.
 // If there is any space left after that due to alignment, fill it with 0.
 // static
-void FillDebugBreak(_In_ BYTE* buffer, __in size_t byteCount)
+void FillDebugBreak(_Out_writes_bytes_all_(byteCount) BYTE* buffer, _In_ size_t byteCount)
 {
 #if defined(_M_ARM)
     // On ARM there is breakpoint instruction (BKPT) which is 0xBEii, where ii (immediate 8) can be any value, 0xBE in particular.

+ 1 - 1
lib/Common/Memory/CustomHeap.h

@@ -572,6 +572,6 @@ typedef Heap<SectionAllocWrapper, PreReservedSectionAllocWrapper> OOPHeap;
 // Helpers
 unsigned int log2(size_t number);
 BucketId GetBucketForSize(DECLSPEC_GUARD_OVERFLOW size_t bytes);
-void FillDebugBreak(_In_ BYTE* buffer, __in size_t byteCount);
+void FillDebugBreak(_Out_writes_bytes_all_(byteCount) BYTE* buffer, _In_ size_t byteCount);
 } // namespace CustomHeap
 } // namespace Memory