acrn-hypervisor/misc/config_tools/board_inspector/acpiparser
Junjie Mao 4cb0d95fc0 board_inspector: try mroe type convertions when evaluating branch conditions
In commit e5ba06cbe8 ("board_inspector: a workaround to an incorrect
interpretation") a workaround is introduced to check the data type of
predicate operands. That commit assumes that both operands must be exactly
integers, which is not usually the case as operation fields or strings can
also be used in predicates.

This patch applies the following conversions on both operands when
evaluating a predicate:

  1. Try converting both operands to integers

  2. If either conversion in step 1 fails, try regarding both operands as
     strings.

  3. If either operand is not a string, return the default
     result (i.e. False).

Fixes: e5ba06cbe8 ("board_inspector: a workaround to an incorrect interpretation")
Tracked-On: #6287
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
2021-08-09 13:59:16 +08:00
..
aml board_inspector: try mroe type convertions when evaluating branch conditions 2021-08-09 13:59:16 +08:00
__init__.py board_inspector: add a parser of PCI routing tables 2021-08-09 09:05:01 +08:00
_utils.py board-inspector: reorganize the scripts 2021-05-16 19:02:00 +08:00
apic.py board-inspector: reorganize the scripts 2021-05-16 19:02:00 +08:00
asf.py board-inspector: reorganize the scripts 2021-05-16 19:02:00 +08:00
dmar.py board-inspector: reorganize the scripts 2021-05-16 19:02:00 +08:00
dsdt.py board_inspector: extend DSDT parser to allow parsing arbitrary trees 2021-08-09 09:05:01 +08:00
facp.py board-inspector: reorganize the scripts 2021-05-16 19:02:00 +08:00
prt.py board_inspector: add a parser of PCI routing tables 2021-08-09 09:05:01 +08:00
rdt.py board_inspector: add GPIO and generic serial connection parsers 2021-08-09 09:05:01 +08:00
rtct.py board_inspector/acpiparser: enable parsing RTCT v2 2021-05-19 08:53:38 +08:00