abi_symbols: better error message on failed regexp match

Fixes #3455
This commit is contained in:
Christian Prochaska 2019-07-18 13:14:46 +02:00 committed by Christian Helmuth
parent ce149397ec
commit 1f56ffa51a
1 changed files with 7 additions and 3 deletions

View File

@ -37,10 +37,14 @@ foreach line [split $symbols "\n"] {
set type "U"
# match undefined symbol
regexp {^(\w+) U\s*$} $line dummy name
if {![regexp {^(\w+) U\s*$} $line dummy name]} {
# match defined symbol, which does not always feature a size value
regexp {^([\w.]+) (\w) \w+ ?(\w*)$} $line dummy name type size_hex
# match defined symbol, which does not always feature a size value
if {![regexp {^([\w.]+) (\w) \w+ ?(\w*)$} $line dummy name type size_hex]} {
puts stderr "Error: unexpected format of line: $line"
exit -1
}
}
# decimal symbol size
set size_dec [expr 0x0$size_hex]