summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-03-18 12:32:02 (GMT)
committerGitHub <noreply@github.com>2020-03-18 12:32:02 (GMT)
commitcf5e0a3dbd3a31c2314e58e55bbdff66b3f49876 (patch)
tree823495ffcbae4d8ed726d1d2c3a2e34f355e77eb /src
parent7056d96f30d40e4b632adde13dbbc29a3ad82d61 (diff)
downloadDoxygen-cf5e0a3dbd3a31c2314e58e55bbdff66b3f49876.zip
Doxygen-cf5e0a3dbd3a31c2314e58e55bbdff66b3f49876.tar.gz
Doxygen-cf5e0a3dbd3a31c2314e58e55bbdff66b3f49876.tar.bz2
Tcl has a problem with a case statement with just {} inside the switch statement (#7643)
In case we have a (reduced) case like: ``` ## ::tkcon::Init - inits tkcon proc ::tkcon::Init {} { switch -glob -- $arg { -root { set PRIV(root) $val } -font { set OPT(font) $val } -rcfile {} } } ``` and a default doxygen configuration file, doxygen will crash in the tcl scanner as the `{}` results in an empty string. Some notes, crash only happens when compilation for 'Release; or 'RelWithDebInfo' as 'CMAKE_BUILD_TYPE'. (Found by Fossies for magic 8.2.195).
Diffstat (limited to 'src')
-rw-r--r--src/tclscanner.l1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tclscanner.l b/src/tclscanner.l
index 10aba97..2e15fc5 100644
--- a/src/tclscanner.l
+++ b/src/tclscanner.l
@@ -1173,6 +1173,7 @@ tcl_inf("line=%d type=%d '%s'\n",tcl.line_body0,type,content.data());
myScan->type[0] = type;
break;
case '?':
+ if (content.isEmpty()) break;
if (content[0]=='"' && content[content.length()-1]=='"') myScan->type[0]='"';
if (content[0]=='{' && content[content.length()-1]=='}') myScan->type[0]='{';
if (content[0]=='[' && content[content.length()-1]==']') myScan->type[0]='[';