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
Subst.compose is coded wrongly. #4996
Original bug ID: 4996
Correct me if I am wrong, but after studying the code for substitutions in subst.ml I think, that 'Subst.compose' is wrong. It should concatenate two substitutions 'suba' and 'subb', but in fact only concatenates entries, which are already present in 'subb'. If 'subb' is the identity (empty tables), the composition should be 'suba', but is in fact also wrongly the identity substitution. The function 'Subst.compose' is only used for relocation of debugging info when packaging CMO-files. Therefore I think this makes the debugger unhappy with packed CMO-files. There is already a bug about this topic, but its closed. But the reason for that bug might not come from the debugger itself, but is possibly present because of this issue with 'compose'.
Comment author: @xavierleroy
Well spotted. I fixed the implementation so that it is a proper composition. We will see what impacts this has on debug info for packed modules, but I optimistically assume it can only make them better. Will go in 3.12.0.