New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of @@ seems to trip backtrace line reports #6920
Comments
Comment author: @dbuenzli Also sometimes use of @@ suppresses the location. Here again removing the @@ allows to regain the location.
let () = f ()
|
Comment author: @gasche Currently the implementation of (@@) and (|>) is using primitives that are optimised (early in the compiler passes). I think I would be in favor of just implementing them with their obvious definition, to get rid of these issues. |
Comment author: @damiendoligez @gasche but it's important to guarantee that they incur no run-time overhead. |
Comment author: @diml Looking at the -dlambda diff, in both Daniel's examples the problem comes from a missing "after" event when using @@: --- /tmp/good.lambda 2015-06-30 11:21:22.349788092 +0100
Looking at translcore.ml this happens only when the primitive is applied to as many arguments as its arity. For instance when adding one argument to [why] we regain the correct location:
Adding [Pdirapply] and [Prevapply] to [Translcore.primitive_is_ccall] fixes this issue. Looking at the code I'd say it is safe to do so but I'm not 100% sure. I attached a patch. |
Comment author: @xavierleroy The proposed patch looks reasonable to me. Jeremy, if you're still happy with this code, please commit it to trunk. (And mark this PR as resolved.) |
Original bug ID: 6920
Reporter: @dbuenzli
Assigned to: @diml
Status: closed (set by @xavierleroy on 2017-02-16T14:16:24Z)
Resolution: fixed
Priority: normal
Severity: minor
OS: macosx
OS Version: 10.10.3
Version: 4.02.2
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Has duplicate: #6258
Monitored by: @gasche @diml @ygrek @hcarty @dbuenzli
Bug description
Behaviour was tested with both 4.02.1 and 4.02.2.
The use of @@ sometimes reports the backtrace on the next line, see the steps to reproduce.
Steps to reproduce
The following backtrace wrongly report line 4
let () = f ()
If I remove the @@ the report is correct
let () = f ()
File attachments
The text was updated successfully, but these errors were encountered: