Test 1(original 234 compiled by me) - failed
Test 2(modified 234 with log_and_print) - FAILED
Ok, WTF!?
Good thing that I kept 233
After a diff I noticed something. The seemingly unrelated
log_and_print addition was not the only one. Coming from c++(or any sane language, for that matter
), I've also put a
begin and
end block starting with line 157(in 234).
So
if istis = "TIS V1 " then begin
let istis = String.create 24 in
(* have it skip the first 24 bytes *)
my_read 24 in_fd istis f ;
copy_over in_fd f (s - 24) ;
end else
copy_over in_fd f s ;
;
became
if istis = "TIS V1 " then begin
let istis = String.create 24 in
(* have it skip the first 24 bytes *)
my_read 24 in_fd istis f ;
copy_over in_fd f (s - 24) ;
end else begin
copy_over in_fd f s ;
end;
I didn't think that this even more seemingly unrelated change would affect anything. I've only put it there because I previously had another log_and_print(while pursuing my flush guess) after the else and didn't really knew how OCaml works with blocks.
So yeah, seems like the
log_and_print call in copy_over doesn't do anything, but the
begin/end change does. The irony.
That's the only change that I didn't mention, I promise
I am really interested in the reason why this happens. My only guess would be a compiler bug, but who the hell knows
I've also noticed that the exe from the original code that I compiled is a little smaller than the exe from the package that you provided.
I've attached my compilation in case anyone needs it and can't wait for an official release. Check the first post in the thread.
Edited by tuxr, 24 October 2013 - 07:41 AM.