소스 검색

UserspaceEmulator: Make sure ELF data segments are zero-initialized

(And all other memory, too.) This will mutate later when we add shadow
memory etc, but for now just zero-initialize it since that's expected
by the emulated program.
Andreas Kling 5 년 전
부모
커밋
ce51cf90c6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      DevTools/UserspaceEmulator/Emulator.cpp

+ 1 - 1
DevTools/UserspaceEmulator/Emulator.cpp

@@ -42,7 +42,7 @@ public:
     SimpleRegion(u32 base, u32 size)
         : Region(base, size)
     {
-        m_data = (u8*)malloc(size);
+        m_data = (u8*)calloc(1, size);
     }
 
     ~SimpleRegion()