[PATCH] D65946: [llvm-readobj] - Remove deprecated unwrapOrError(Expected<T> EO).

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 02:00:27 PDT 2019


grimar added inline comments.


================
Comment at: test/Object/invalid.test:229
 
-# INVALID-PH-ENTSIZE: error: invalid e_phentsize: 12336
+# INVALID-PH-ENTSIZE: error: '{{.*}}invalid-e_shnum.elf': invalid e_phentsize: 12336
 
----------------
jhenderson wrote:
> Aside: it's rather weird that invalid-e_shnum is being used to test an invalid e_phentsize...!
Initially this file was introduced to report "e_shnum should be zero if a file has no section header table" (D25090)
Then rL285738 changed it to "Invalid data was encountered while parsing the file." and
after that rL287081 changed it to "invalid e_phentsize".

This is a result of error catching code change multiplied by effect from having a black box precompiled binary committed.
(It was a binary produced using fuzzing as far I remember, so it could be broken in a many places)
We should just get rid of them all.


================
Comment at: test/Object/invalid.test:247
 
-# INVALID-RELOC-SH-OFFSET: error: section [index 1] has a sh_offset (0x10000) + sh_size (0x0) that cannot be represented
+# INVALID-RELOC-SH-OFFSET: error: '{{.*}}': section [index 1] has a sh_offset (0x10000) + sh_size (0x0) that cannot be represented
 
----------------
jhenderson wrote:
> I think you can use -D here, right, like in %t10 case above and others?
Yes, done.


================
Comment at: test/Object/invalid.test:429
 
-# PHENTSIZE: error: invalid e_phentsize: 57
+# PHENTSIZE: error: '{{.*}}corrupt-invalid-phentsize.elf.x86-64': invalid e_phentsize: 57
 
----------------
MaskRay wrote:
> Why can't this check use `[[FILE]]`?
It can. I did not like how `-DFILE=%p/Inputs/corrupt-invalid-phentsize.elf.x86-64` looks like (too long),
but after another look, I am OK with it.


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

https://reviews.llvm.org/D65946





More information about the llvm-commits mailing list