From 450f2ccfb0b6d85fba51654b47d2934610c8acb3 Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Tue, 19 Feb 2019 16:58:07 +0900 Subject: [PATCH] opcode of Operation is needed to free member value --- src/regexec.c | 12 ++---------- src/regint.h | 13 ++++++------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/regexec.c b/src/regexec.c index 80c98cb..2991036 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -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 diff --git a/src/regint.h b/src/regint.h index e25568c..6800e6d 100644 --- a/src/regint.h +++ b/src/regint.h @@ -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 { -- 2.50.1