sim: common: add basic model assert
If the configured in default doesn't match a known value, throw an assertion failure rather than segfaulting deeper down.
This commit is contained in:
parent
f55b33d51b
commit
ccd4b2953b
|
@ -1,3 +1,7 @@
|
|||
2015-06-21 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* sim-model.c (sim_model_init): Assert model is not NULL.
|
||||
|
||||
2015-06-21 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* sim-types.h: Move SIM_TYPES_H define to top of file. Include
|
||||
|
|
|
@ -204,6 +204,7 @@ sim_model_init (SIM_DESC sd)
|
|||
{
|
||||
/* Set the default model. */
|
||||
const MODEL *model = sim_model_lookup (WITH_DEFAULT_MODEL);
|
||||
SIM_ASSERT (model != NULL);
|
||||
sim_model_set (sd, NULL, model);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue