# RUN: yaml2obj %s -o %t.exe # RUN: llvm-objdump --unwind-info %t.exe 2>%t.err | FileCheck %s # RUN: FileCheck %s --check-prefix=WARN < %t.err ## T17: V3 malformed — WOD_PUSH_CONSECUTIVE_2 with Register=31. ## Per the spec, Register must be in [0,30] because the instruction pushes ## Register and Register+1; Register=31 would put Register+1 (R32) out of ## bounds. The decoder must reject this. ## ## .xdata hex breakdown: ## Byte 0: 0x03 (Version=3, Flags=0) ## Byte 1: 0x02 (SizeOfProlog=2) ## Byte 2: 0x02 (PayloadWords=2 words -> 4 bytes payload) ## Byte 3: 0x01 (NumberOfOps=1, NumberOfEpilogs=0) ## +0: 02 Prolog IP offset[0]: +2 ## +1: FF WOD pool[0]: WOD_PUSH_CONSECUTIVE_2 Register=31 (INVALID) ## ((31<<3) | 7) = 0xFF ## +2: 00 Padding ## +3: 00 Padding # CHECK-LABEL: Unwind info: # CHECK-EMPTY: # CHECK-NEXT: Function Table: # CHECK-NEXT: Start Address: 0x1000 # CHECK-NEXT: End Address: 0x1010 # CHECK-NEXT: Unwind Info Address: 0x2000 # CHECK-NEXT: Version: 3 # CHECK-NEXT: Flags: 0x0 # CHECK-NEXT: Size of prolog: 0x2 # CHECK-NEXT: PayloadWords: 2 # CHECK-NEXT: NumberOfOps: 1 # CHECK-NEXT: NumberOfEpilogs: 0 # CHECK-NEXT: Prolog [1 ops]: # CHECK-EMPTY: # WARN: warning: WOD_PUSH_CONSECUTIVE_2 Register=31 out of range [0,30] at pool offset 0 --- !COFF OptionalHeader: AddressOfEntryPoint: 4096 ImageBase: 0 SectionAlignment: 4096 FileAlignment: 512 MajorOperatingSystemVersion: 6 MinorOperatingSystemVersion: 0 MajorImageVersion: 0 MinorImageVersion: 0 MajorSubsystemVersion: 6 MinorSubsystemVersion: 0 Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT ] SizeOfStackReserve: 1048576 SizeOfStackCommit: 4096 SizeOfHeapReserve: 1048576 SizeOfHeapCommit: 4096 ExportTable: RelativeVirtualAddress: 0 Size: 0 ImportTable: RelativeVirtualAddress: 0 Size: 0 ResourceTable: RelativeVirtualAddress: 0 Size: 0 ExceptionTable: RelativeVirtualAddress: 12288 Size: 12 CertificateTable: RelativeVirtualAddress: 0 Size: 0 BaseRelocationTable: RelativeVirtualAddress: 0 Size: 0 Debug: RelativeVirtualAddress: 0 Size: 0 Architecture: RelativeVirtualAddress: 0 Size: 0 GlobalPtr: RelativeVirtualAddress: 0 Size: 0 TlsTable: RelativeVirtualAddress: 0 Size: 0 LoadConfigTable: RelativeVirtualAddress: 0 Size: 0 BoundImport: RelativeVirtualAddress: 0 Size: 0 IAT: RelativeVirtualAddress: 0 Size: 0 DelayImportDescriptor: RelativeVirtualAddress: 0 Size: 0 ClrRuntimeHeader: RelativeVirtualAddress: 0 Size: 0 header: Machine: IMAGE_FILE_MACHINE_AMD64 Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ] sections: - Name: .text Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] VirtualAddress: 4096 VirtualSize: 16 SectionData: '00000000000000000000000000000000' - Name: .xdata Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] VirtualAddress: 8192 VirtualSize: 8 SectionData: '0302020102FF0000' - Name: .pdata Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] VirtualAddress: 12288 VirtualSize: 12 SectionData: '001000001010000000200000' symbols: - Name: .text Value: 0 SectionNumber: 1 SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - Name: .xdata Value: 0 SectionNumber: 2 SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - Name: .pdata Value: 0 SectionNumber: 3 SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC ...