Fix handling of Printexc.raise_with_backtrace under partial application#1465
Fix handling of Printexc.raise_with_backtrace under partial application#1465nojb wants to merge 4 commits intoocaml:trunkfrom
Conversation
|
I believe that the fix is correct, but I find it unsatisfying.
|
|
(Looking more at the code of (cc @let-def and @bobot who may have an opinion about this code) |
|
Thanks for the review @gasche. Indeed, I did not overlook the code duplication. But I held off doing it in the first try because 1) I wanted to make sure the fix was correct before refactoring, and 2) there are a couple other "special" primitives that would also profit from this kind of refactoring. I will give some thought to refactoring along the lines of your 2. and 3. |
| transl_exp e | ||
| | `Float -> | ||
| | `Float -> | ||
| (* We don't need to wrap with Popaque: this forward |
There was a problem hiding this comment.
Whilst looking at this PR I noticed the (unrelated) thing that maybe this comment is wrong when the float array optimization is disabled, as it may be in 4.06 onwards. @chambart ?
There was a problem hiding this comment.
I don't know if this is the case, but this might change. We should indeed take the safe way here.
|
I think (1) is a necessary first step (I don't really agree with @nojb's view that explicit duplication helps ensure that the patch is correct, because I have to check that the two places do the same thing to review it, whereas a function abstraction would make that immediate), but that it does not solve the longer-term problem that the addition of any additional primitive is likely to be broken in the same way if we don't make try to rule this error out. |
I don't see why, |
|
@gasche FWIW, I do not think it helps check the patch is correct, but the refactoring itself is not completely trivial so I thought it would be better to separate the two. |
-no-flat-float-array. Problem reported by Mark Shinwell in ocaml#1465 (review)
f23a761 to
7754923
Compare
|
Closing this to concentrate efforts on #1557 which is a much more general solution to fixing the issues addressed by this PR. |
-no-flat-float-array. Problem reported by Mark Shinwell in ocaml#1465 (review)
-no-flat-float-array. Problem reported by Mark Shinwell in ocaml#1465 (review)
…#1471) Fix interaction between lazy and float when configured with -no-flat-float-array. Problem reported by Mark Shinwell in #1465 (review)
…#1471) Fix interaction between lazy and float when configured with -no-flat-float-array. Problem reported by Mark Shinwell in #1465 (review)
Co-authored-by: Christine Rose <christinerose@users.noreply.github.com>
See MPR#7666 and #378. The case of the primitive
%raise_with_backtracebeing partially applied was not being handled, which would end up being considered as a (partially-applied) C primitive and fail.This PR adds the missing case and a corresponding test.