From: Nirbheek Chauhan Date: Thu, 2 Jul 2020 09:32:57 +0000 (+0530) Subject: orc: Don't set memory protection if there's no code X-Git-Tag: orc-0.4.33~90 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ec0f3f9238d44eb9c60d72c3572c42c98cf2ad4;p=platform%2Fupstream%2Forc.git orc: Don't set memory protection if there's no code If the size of the JIT code is 0, there's no code and the *mem is uninitialized. This can happen when orcc.exe is used to generate backup C code. Part-of: --- diff --git a/orc/orccompiler.c b/orc/orccompiler.c index 23a1a84..63eee29 100644 --- a/orc/orccompiler.c +++ b/orc/orccompiler.c @@ -223,6 +223,9 @@ _set_virtual_protect (void * mem, size_t size, int code_protect) char *msg; DWORD old_protect; + /* No code, so we 'succeed' */ + if (size == 0) + return TRUE; if (!mem) return FALSE;