Mark Obj_dup as not having effects and handle in Cfg #3766
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This marks
Obj_dup
as not having effects in the primitive translation out of Flambda 2. ThenCfg.can_raise_terminator
is modified to take account of the neweffects
propagation from #3765. The result is that the included test case now passes, whereas before it failed, by virtue ofTo_cmm
not having wrapped theC.extcall
forObj_dup
with an extra argument wrapper (such wrapper always being redundant).This PR has to change the C stub
caml_obj_dup
so it never has effects: prior to this PR there is a corner case where an exception may be raised, but I think it's fine for this to change to aCAMLassert
. Otherwise it is just like an allocation, which never raises (except for asynchronous effects, but that isn't relevant here).Based on #3765, only the second commit here is new.