diff options
author | Gerhard Sittig <gerhard.sittig@gmx.net> | 2017-06-18 12:24:32 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2017-06-21 17:45:15 +0200 |
commit | a912e8cbb6ab4a56bee71a9c0fd0045d5fdee55c (patch) | |
tree | 6eeed19be07104b15a2a7d9d7565b520be08bd03 /error.c | |
parent | 6120ff64d4096bcb32c8a42f06ff77d75a5326c2 (diff) | |
download | libsigrokdecode-a912e8cbb6ab4a56bee71a9c0fd0045d5fdee55c.tar.gz libsigrokdecode-a912e8cbb6ab4a56bee71a9c0fd0045d5fdee55c.zip |
lpc: Improve robustness when decoding unexpected input data
The 'fields' table of state and descriptions is not fully populated,
some slots are missing. Cope with lookup misses when unexpected input
data is not found in the table. Use different error text in annotations
for described but invalid states (the previous implementation used
"reserved / invalid"), and for states that are not described in the
table (introduce the "reserved / unknown" text for conditions that are
not covered by the decoder implementation).
The previous implementation missed the emission of some warnings. When a
"reserved / invalid" description was found, the subsequent exact match
for "reserved" failed and the warning was not emitted. Weaken the test
to emit warnings for either description that has "reserved" in it,
regardless of whether the text was found in the table or is not part of
the table at all.
Diffstat (limited to 'error.c')
0 files changed, 0 insertions, 0 deletions