Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
ocamlopt generates segfaulting code when using [with] on recursive record with 6+ fields. #5819
Original bug ID: 5819
% ocamlopt -version
Comment author: @alainfrisch
I'm not a back-end specialist, so I cannot really comment on the proposed patch (except that I believe Record_regular should be Types.Record_regular, etc, unless you're already on the record_disambiguation branch!). But while trying to understand the general compilation strategy for recursive bindings, I found the following lines which I don't really understand:
let rec init_blocks = function
Why do we do that, instead of simply calling "init_block rem" in the RHS_nonrec case? At least, this might allow to catch earlier this kind of bugs. Or are there cases where those dummy bindings are actually needed?
Comment author: @damiendoligez
I have uploaded a better patch (provided by XL). I have committed it in the 4.00 branch, but not in trunk because we still need to decide whether/how to refactor this function to make it common to the byte-code and native back-ends.
Fixed in 4.00 (r 13110), but this PR stays open until we rework the code in the trunk.
I don't have an answer to frisch's question for the moment.