Check for existence of config dict fields before using them in generated drivers

This commit is contained in:
Douglas Clowes
2014-06-30 12:49:22 +10:00
parent 62f1170a6d
commit 202004766a
18 changed files with 198 additions and 36 deletions

View File

@@ -1156,12 +1156,21 @@ proc ::scobj::hiden_xcs::read_config {} {
set ns "::scobj::hiden_xcs"
dict for {k v} $::config_dict {
if { [dict exists $v "implementation"] } {
if { !([dict exists $v "name"] && [dict exists $v "enabled"]) } {
continue
}
set name [dict get $v name]
set enabled [string tolower [dict get $v "enabled"]]
set implementation [dict get $v "implementation"]
if { !([dict exists $::config_dict $implementation]) } {
continue
}
set v [dict get $::config_dict $implementation]
if { [dict get $v "driver"] == "hiden_xcs" } {
if { [dict get $v enabled] } {
if { !([dict exists $v "driver"]) } {
continue
}
if { [string equal -nocase [dict get $v "driver"] "hiden_xcs"] } {
if { [string equal -nocase $enabled "true" ] || [string equal -nocase $enabled "always"] } {
if { ![string equal -nocase [SplitReply [environment_simulation]] "false"] } {
set asyncqueue "null"
${ns}::sics_log 9 "[environment_simulation] => using null asyncqueue"