Hi, 


I pushed a small Win32 fix to mob:



6728a64f win32: use VirtualAlloc for run memory



The change addresses an issue reported by Bitdefender with the previous runtime 
memory allocation path in tccrun.c.



On Windows, tccrun allocated run memory using tcc_malloc, then later changed 
page protections for the generated code.

Since malloc memory comes from the CRT heap, changing protection at page 
granularity can affect heap pages that may contain unrelated CRT heap data. 
This is also the kind of behavior that security software can flag.



The patch changes the Win32 path to allocate this memory with VirtualAlloc, so 
the generated code area lives in dedicated pages managed directly with Windows 
virtual memory APIs. It is then released with VirtualFree. I also added an 
allocation failure check.


Build and tests run correctly un msys2/mingw64.


Regards,



Mounir IDRASSI
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to