[Pcre-svn] [669] code/trunk/pcre_jit_compile.c: Fix unset me…

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [669] code/trunk/pcre_jit_compile.c: Fix unset memory bug found by valgrind .
Revision: 669
          http://vcs.pcre.org/viewvc?view=rev&revision=669
Author:   ph10
Date:     2011-08-23 10:56:11 +0100 (Tue, 23 Aug 2011)


Log Message:
-----------
Fix unset memory bug found by valgrind.

Modified Paths:
--------------
    code/trunk/pcre_jit_compile.c


Modified: code/trunk/pcre_jit_compile.c
===================================================================
--- code/trunk/pcre_jit_compile.c    2011-08-22 15:08:53 UTC (rev 668)
+++ code/trunk/pcre_jit_compile.c    2011-08-23 09:56:11 UTC (rev 669)
@@ -5836,7 +5836,7 @@
 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(localsize + framesize + alternativesize - 1), TMP2, 0);
 copy_locals(common, ccbegin, ccend, TRUE, localsize + framesize + alternativesize, framesize + alternativesize);
 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), RECURSIVE_HEAD, STACK_TOP, 0);
-if (framesize > 0)
+if (needsframe)
   {
   OP2(SLJIT_SUB, TMP2, 0, STACK_TOP, 0, SLJIT_IMM, -STACK(framesize + alternativesize - 1));
   init_frame(common, cc, framesize + alternativesize - 1, alternativesize, FALSE);
@@ -5877,7 +5877,8 @@
   }
 /* None of them matched. */
 OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 0);
-OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS_HEAD, SLJIT_MEM1(STACK_TOP), STACK(alternativesize));
+if (needsframe)
+  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS_HEAD, SLJIT_MEM1(STACK_TOP), STACK(alternativesize));
 jump = JUMP(SLJIT_JUMP);


set_jumps(common->accept, LABEL());