[ES40-developers] Patch: graceful shutdown if syntax error in config
Status: Alpha
Brought to you by:
iamcamiel
|
From: brian w. <bdw...@in...> - 2008-02-04 19:52:26
|
It looks like the configurator doesn't catch missing '}' in the
configuration file. This patch catches when theSystem doesn't get setup
correctly and exits gracefully instead of segfaulting when trying to
load the rom file.
Brian
===================================================================
diff -u -r1.38 AlphaSim.cpp
--- AlphaSim.cpp 26 Jan 2008 12:21:59 -0000 1.38
+++ AlphaSim.cpp 4 Feb 2008 19:51:47 -0000
@@ -253,6 +253,11 @@
fclose(f);
free(ch1);
+ if(!theSystem) {
+ printf("%%SYS-F-INIT: Initialization of system has failed.
Syntax error in config?.\n",theSystem);
+ exit(1);
+ }
+
#if defined(IDB)
trc = new CTraceEngine(theSystem);
#endif
====================================================================
|