File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -305,8 +305,8 @@ void MachOWriter::writeLoadCommands(raw_ostream &OS) {
305305 if (NameCStr)
306306 Name = NameCStr;
307307 else
308- Name =
309- " (0x " + Twine::utohexstr (LC. Data . load_command_data . cmd ). str () + " ) " ;
308+ Name = ( " (0x " + Twine::utohexstr (LC. Data . load_command_data . cmd ) + " ) " )
309+ . str ();
310310
311311 WithColor::warning () << " load command " << i << " " << Name
312312 << " cmdsize too small ("
Original file line number Diff line number Diff line change 11# # Test that yaml2obj handles load commands with cmdsize smaller than the
22# # actual structure size without crashing (due to integer underflow).
33
4+ # # Test with a known load command (LC_SEGMENT_64).
45# RUN: yaml2obj %s --docnum=1 -o %t1 2>&1 | FileCheck %s --check-prefix=WARNING-KNOWN
56# RUN: not llvm-readobj --file-headers %t1 2>&1 | FileCheck %s --check-prefix=MALFORMED
67
7- # RUN: yaml2obj %s --docnum=2 -o %t2 2>&1 | FileCheck %s --check-prefix=WARNING-UNKNOWN
8-
98# WARNING-KNOWN: warning: load command 0 LC_SEGMENT_64 cmdsize too small (56 bytes) for actual size (72 bytes)
109
1110# MALFORMED: error: {{.*}}: truncated or malformed object (load command 0 LC_SEGMENT_64 cmdsize too small)
12-
13- # WARNING-UNKNOWN: warning: load command 0 (0xdeadbeef) cmdsize too small (8 bytes) for actual size (20 bytes)
14-
15- # # Test with a known load command (LC_SEGMENT_64)
1611--- !mach-o
1712FileHeader :
1813 magic : 0xFEEDFACF
@@ -37,7 +32,10 @@ LoadCommands:
3732 flags : 0
3833...
3934
40- # # Test with an unknown load command value
35+ # # Test with an unknown load command value.
36+ # RUN: yaml2obj %s --docnum=2 -o %t2 2>&1 | FileCheck %s --check-prefix=WARNING-UNKNOWN
37+
38+ # WARNING-UNKNOWN: warning: load command 0 (0xdeadbeef) cmdsize too small (8 bytes) for actual size (20 bytes)
4139--- !mach-o
4240FileHeader :
4341 magic : 0xFEEDFACF
You can’t perform that action at this time.
0 commit comments