On May 13, 2026 5:32:37 AM UTC, Mounir IDRASSI via Tinycc-devel 
<[email protected]> wrote:
>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.

Hi, 

I don't think that this can happen. You can use "tcc -vv -run ..." to see 
allocation and permission details.

Also, if it were a problem then why would it be only on windows?

Maybe it's a bug in bitdefender?

>
>
>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