File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 98
98
99
99
handle (sections:: MachOSections ) = sections. handle
100
100
lastindex (sections:: MachOSections ) = lastindex (sections. sections)
101
- getindex (sections:: MachOSections , idx) = getindex (sections. sections, idx)
101
+ function getindex (sections:: MachOSections{H} , idx) where {H <: MachOHandle }
102
+ section = sections. sections[idx]
103
+ return MachOSectionRef (sections, section, UInt32 (idx))
104
+ end
102
105
103
106
Sections (segs:: MachOSegments ) = MachOSections (segs)
104
107
Sections (oh:: MachOHandle ) = Sections (Segments (oh))
@@ -108,7 +111,7 @@ Sections(oh::MachOHandle) = Sections(Segments(oh))
108
111
109
112
Mach-O `SectionRef` type
110
113
"""
111
- struct MachOSectionRef{H <: MachOHandle } <: Sections {H}
114
+ struct MachOSectionRef{H <: MachOHandle } <: SectionRef {H}
112
115
sections:: MachOSections{H}
113
116
section:: MachOSection{H}
114
117
idx:: UInt32
117
120
function SectionRef (sections:: MachOSections , s:: MachOSection , idx)
118
121
return MachOSectionRef (sections, s, UInt32 (idx))
119
122
end
120
- @derefmethod is64bit (s:: MachOSectionRef )
123
+ deref (s:: MachOSectionRef ) = s. section
124
+ sections (s:: MachOSectionRef ) = s. sections
125
+ handle (s:: MachOSectionRef ) = handle (sections (s))
126
+ section_number (s:: MachOSectionRef ) = s. idx
127
+ @derefmethod is64bit (s:: MachOSectionRef )
You can’t perform that action at this time.
0 commit comments