Skip to content

Commit f9b66dc

Browse files
committed
Update Lean to current nightly
1 parent 8f3d6e7 commit f9b66dc

File tree

7 files changed

+64
-200
lines changed

7 files changed

+64
-200
lines changed

ELFSage/Types/ELFHeader.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def ELFHeader.ph_end [ELFHeader α] (eh : α) :=
7272

7373
instance [ELFHeader α] : ToString α where
7474
toString eh :=
75-
let ident (i : Fin 16) := (ELFHeader.e_ident eh).bytes.get ⟨ i, by simp [(ELFHeader.e_ident eh).sized]
75+
let ident (i : Fin 16) := (ELFHeader.e_ident eh).bytes[i]'(by simp [(ELFHeader.e_ident eh).sized])
7676
let identAsHex (i: Fin 16) := toHex (ident i).toNat
7777
let identAsHexLength2 (i: Fin 16) := toHexMinLength (ident i).toNat 2
7878
"ElfHeader {\n" ++
@@ -149,7 +149,7 @@ def mkELF64Header (bs : ByteArray) (h : bs.size ≥ 0x40) : ELF64Header := {
149149
e_shnum := getUInt16from 0x3C (by omega),
150150
e_shstrndx := getUInt16from 0x3E (by omega),
151151
} where
152-
isBigEndian := bs.get ⟨0x5,by omega⟩ == 2
152+
isBigEndian := bs[0x5] == 2
153153
getUInt16from := if isBigEndian then bs.getUInt16BEfrom else bs.getUInt16LEfrom
154154
getUInt32from := if isBigEndian then bs.getUInt32BEfrom else bs.getUInt32LEfrom
155155
getUInt64from := if isBigEndian then bs.getUInt64BEfrom else bs.getUInt64LEfrom
@@ -243,7 +243,7 @@ def mkELF32Header (bs : ByteArray) (h : bs.size ≥ 0x34) : ELF32Header := {
243243
e_shnum := getUInt16from 0x30 (by omega),
244244
e_shstrndx := getUInt16from 0x32 (by omega),
245245
} where
246-
isBigEndian := bs.get ⟨0x5,by omega⟩ == 2
246+
isBigEndian := bs[0x5] == 2
247247
getUInt16from := if isBigEndian then bs.getUInt16BEfrom else bs.getUInt16LEfrom
248248
getUInt32from := if isBigEndian then bs.getUInt32BEfrom else bs.getUInt32LEfrom
249249

@@ -311,7 +311,7 @@ instance : ELFHeader RawELFHeader where
311311

312312
def mkRawELFHeader? (bs : ByteArray) : Except String RawELFHeader :=
313313
if h : bs.size < 5 then throw "Can't determine if this is a 32 or 64 bit binary (not enough bytes)."
314-
else match bs.get ⟨0x4, by omega⟩ with
314+
else match bs[0x4] with
315315
| 1 => .elf32 <$> mkELF32Header? bs
316316
| 2 => .elf64 <$> mkELF64Header? bs
317317
| _ => throw "Can't determine if this is a 32 of 64 bit binary (byte 0x5 of the elf header is bad)"

ELFSage/Types/File.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ inductive RawELFFile where
125125

126126
def mkRawELFFile? (bytes : ByteArray) : Except String RawELFFile :=
127127
if h : bytes.size < 5 then throw "Can't determine if this is a 32 or 64 bit binary (not enough bytes)."
128-
else match bytes.get ⟨0x4, by omega⟩ with
128+
else match bytes[0x4] with
129129
| 1 => .elf32 <$> mkELF32File? bytes
130130
| 2 => .elf64 <$> mkELF64File? bytes
131131
| _ => throw "Can't determine if this is a 32 of 64 bit binary (byte 0x5 of the elf header is bad)"

ELFSage/Types/SymbolTable.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def mkELF64SymbolTableEntry
4545
(h : bs.size - offset ≥ 0x18) :
4646
ELF64SymbolTableEntry := {
4747
st_name := getUInt32from (offset + 0x00) (by omega),
48-
st_info := bs.get ⟨offset + 0x4, by omega⟩,
49-
st_other := bs.get ⟨offset + 0x5, by omega⟩,
48+
st_info := bs[offset + 0x4]
49+
st_other := bs[offset + 0x5]
5050
st_shndx := getUInt16from (offset + 0x6) (by omega),
5151
st_value := getUInt64from (offset + 0x8) (by omega),
5252
st_size := getUInt64from (offset + 0x10) (by omega),
@@ -87,8 +87,8 @@ def mkELF32SymbolTableEntry
8787
st_name := getUInt32from (offset + 0x00) (by omega),
8888
st_value := getUInt32from (offset + 0x04) (by omega),
8989
st_size := getUInt32from (offset + 0x08) (by omega),
90-
st_info := bs.get ⟨offset + 0x9, by omega⟩,
91-
st_other := bs.get ⟨offset + 0xa, by omega⟩,
90+
st_info := bs[offset + 0x9],
91+
st_other := bs[offset + 0xa],
9292
st_shndx := getUInt16from (offset + 0xb) (by omega) ,
9393
} where
9494
getUInt16from := if isBigEndian then bs.getUInt16BEfrom else bs.getUInt16LEfrom

0 commit comments

Comments
 (0)