Skip to content

Commit 9bf5246

Browse files
use String.concat
1 parent 6ce6d8d commit 9bf5246

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/fasmi/Disassembly.fs

+6-5
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,14 @@ let disassembleConcreteMethod (runtime: ClrRuntime) (mthinfo: MethodBase) platfo
139139
// render instructions
140140
for inst in decoder do
141141
formatter.Format(&inst, out)
142-
let inst_relative_ip = int <| inst.IP - address
142+
let instRelativeIp = int <| inst.IP - address
143143
if showOpcodes then
144-
let inst_opcode_hex = bytes[inst_relative_ip..inst_relative_ip + inst.Length - 1]
145-
|> Array.fold (fun hex b -> sprintf "%s %02x" hex b) ""
146-
writer.WriteLine $"L%04x{inst_relative_ip}: %45s{inst_opcode_hex} %s{out.ToStringAndReset()}"
144+
let inst_opcode_hex = bytes[instRelativeIp..instRelativeIp + inst.Length - 1]
145+
|> Array.map (fun b -> sprintf "%02x" b)
146+
|> String.concat ""
147+
writer.WriteLine $"L%04x{instRelativeIp}: %45s{inst_opcode_hex} %s{out.ToStringAndReset()}"
147148
else
148-
writer.WriteLine $"L%04x{inst_relative_ip}: %s{out.ToStringAndReset()}"
149+
writer.WriteLine $"L%04x{instRelativeIp}: %s{out.ToStringAndReset()}"
149150
writer.Flush()
150151

151152

src/fasmi/fasmi.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageProjectUrl>https://github.com/d-edge/fasmi</PackageProjectUrl>
1818
<RepositoryUrl>https://github.com/d-edge/fasmi</RepositoryUrl>
1919
<PackageLicenseFile>LICENSE</PackageLicenseFile>
20-
<Version>1.1.0</Version>
20+
<Version>1.2.0</Version>
2121
</PropertyGroup>
2222
<ItemGroup>
2323
<Compile Include="FileSystem.fs" />

0 commit comments

Comments
 (0)