[PATCH] D71932: [DWARF] Better detect errors in Address Range Tables.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 27 11:11:57 PST 2019


dblaikie added a comment.

Could these tests all be in one run? (ie: even though the length is "invalid" in terms of parsing the contents of the section - but valid enough to jump to the next contribution and parse that - except, I guess, at an invalid 64 bit length perhaps, because that might be too long to be bothered testing - so perhaps that could be the last test case in the file)



================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp:129-133
+  if (full_length <= first_tuple_offset || full_length % tuple_size != 0)
+    return createStringError(errc::invalid_argument,
+                             "address range table at offset 0x%" PRIx64
+                             " has invalid length",
+                             Offset);
----------------
Worth having two messages here to more specifically communicate the kind of invalidity? ("invalid length" is a bit vague/doesn't really say what to do about the length/why it's a problem - even if this remains as one message, perhaps the message should describe the two kinds of invalidity that could be the problem)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71932/new/

https://reviews.llvm.org/D71932





More information about the llvm-commits mailing list