From e794dc218e09bbb25bd3e34a304aee489c4f10ea Mon Sep 17 00:00:00 2001
From: Kristof Szabados <Kristof.Szabados@ericsson.com>
Date: Tue, 14 Aug 2018 12:30:07 +0200
Subject: [PATCH] correct the check.

Signed-off-by: Kristof Szabados <Kristof.Szabados@ericsson.com>
---
 compiler2/union.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler2/union.c b/compiler2/union.c
index 790770b9d..c3f45005d 100644
--- a/compiler2/union.c
+++ b/compiler2/union.c
@@ -2367,7 +2367,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
             "if (%d == name_len && 0 == strncmp(fld_name, \"%s\", name_len)) {\n"
             "      int ret_val = %s%s().JSON_decode(%s_descr_, p_tok, p_silent);\n"
             "      if (0 > ret_val) {\n"
-            "        if (JSON_ERROR_INVALID_TOKEN) {\n"
+            "        if (JSON_ERROR_INVALID_TOKEN == ret_val) {\n"
             "          JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, %lu, \"%s\");\n"
             "        }\n"
             "        return JSON_ERROR_FATAL;\n"
-- 
GitLab