Skip to content

Commit

Permalink
Merge pull request #270 from paulgazz/fix-config-setting-n-to-nonbool
Browse files Browse the repository at this point in the history
Fix a bug where klocalizer sets nonbools to 'n'
  • Loading branch information
paulgazz authored Aug 6, 2024
2 parents 0cb765e + 4ff8ac4 commit 252053a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kmax/klocalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ def get_config_from_model(model: z3.Model, arch: Arch, set_tristate_m, allow_non
else:
assert(False)
else:
if kconfig_types is None or str_entry in kconfig_types:
# if the solver set the option to false, then set it to 'n' in the output, but only for bool and tristate. using the # CONFIG_A is not set pattern sets the option to false, which isn't valid for nonbools.
if kconfig_types is None or str_entry in kconfig_types and (kconfig_types[str_entry] == "tristate" or kconfig_types[str_entry] == "bool"):
write_to_content( "# %s is not set\n" % (str_entry) )
else:
if str_entry not in Arch.ARCH_CONFIGS:
Expand Down

0 comments on commit 252053a

Please sign in to comment.