Skip to content

Commit 1968921

Browse files
committed
[hxb] display older versions as "1.0", not "2.0"
1 parent 3e2457b commit 1968921

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/compiler/hxb/hxbReader.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,10 +2117,11 @@ class hxb_reader
21172117
raise (HxbFailure "magic");
21182118

21192119
(* Note: as minor version was only added in 2.1, version "1" is now considered to be "2.0" *)
2120+
(* Still displaying it as "1.0" in version mismatch error, hence `major` vs `hxb_major` vars *)
21202121
let major = read_byte ch in
21212122
hxb_minor <- if major == 1 then 0 else read_byte ch;
2122-
let major = if major == 1 then 2 else major in
2123-
if major <> HxbData.hxb_major || hxb_minor > HxbData.hxb_minor then
2123+
let hxb_major = if major == 1 then 2 else major in
2124+
if hxb_major <> HxbData.hxb_major || hxb_minor > HxbData.hxb_minor then
21242125
raise (HxbFailure (Printf.sprintf "version mismatch: hxb version %i.%i, reader version %i.%i" major hxb_minor HxbData.hxb_major HxbData.hxb_minor));
21252126

21262127
(fun end_chunk ->

0 commit comments

Comments
 (0)