]> granicus.if.org Git - onig/commitdiff
opcode of Operation is needed to free member value
authorK.Kosako <kosako@sofnec.co.jp>
Tue, 19 Feb 2019 07:58:07 +0000 (16:58 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Thu, 28 Feb 2019 05:28:18 +0000 (14:28 +0900)
src/regexec.c
src/regint.h

index 80c98cba93ce7e24643bee6a7a996b5e7133554b..2991036262870de380baf232632b48c84e64bbcd 100644 (file)
@@ -2436,18 +2436,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
          MatchArg* msa)
 {
 
-#ifdef ONIG_DEBUG
-#if defined(USE_DIRECT_THREADED_CODE)
-  static Operation FinishCode[] = { {.opcode=OP_FINISH, .opaddr=&&L_FINISH } };
-#else
-  static Operation FinishCode[] = { {OP_FINISH } };
-#endif
-#else
 #if defined(USE_DIRECT_THREADED_CODE)
-  static Operation FinishCode[] = { { {.opaddr=&&L_FINISH} } };
+  static Operation FinishCode[] = { { .opaddr=&&L_FINISH, .opcode=OP_FINISH } };
 #else
-  static Operation FinishCode[] = { { {OP_FINISH} } };
-#endif
+  static Operation FinishCode[] = { { OP_FINISH } };
 #endif
 
 #ifdef USE_GOTO_LABELS_AS_VALUES
index e25568c448b5ed363909c89eb0d987229ebe5622..6800e6d35cf246a0780168261b6e8c9aeecdeafa 100644 (file)
@@ -802,14 +802,10 @@ typedef int ModeType;
 
 
 typedef struct {
-#ifdef ONIG_DEBUG
-  enum OpCode opcode;
+#ifdef USE_DIRECT_THREADED_CODE
   const void* opaddr;
 #else
-  union {
-    enum OpCode opcode;
-    const void* opaddr;
-  };
+  enum OpCode opcode;
 #endif
   union {
     struct {
@@ -914,8 +910,11 @@ typedef struct {
       MemNumType id;
     } callout_name;
 #endif
-
   };
+
+#ifdef USE_DIRECT_THREADED_CODE
+  enum OpCode opcode;
+#endif
 } Operation;
 
 typedef struct {