diff libinterp/parse-tree/token.cc @ 26441:ea624b1c5571 stable

token.cc: Fix static analyzer detected issues (bug #55347). * token.cc (~token): Use if/else if tree for mutually exclusive options.
author Rik <rik@octave.org>
date Fri, 04 Jan 2019 21:21:59 -0800
parents 00f796120a6d
children 581d01526b34
line wrap: on
line diff
--- a/libinterp/parse-tree/token.cc	Fri Jan 04 17:53:23 2019 -0800
+++ b/libinterp/parse-tree/token.cc	Fri Jan 04 21:21:59 2019 -0800
@@ -84,11 +84,9 @@
   {
     if (m_type_tag == string_token)
       delete m_tok_info.m_str;
-
-    if (m_type_tag == sym_rec_token)
+    else if (m_type_tag == sym_rec_token)
       delete m_tok_info.m_sr;
-
-    if (m_type_tag == scls_name_token)
+    else if (m_type_tag == scls_name_token)
       delete m_tok_info.m_superclass_info;
   }