Skip to content

Conversation

reactormonk
Copy link
Contributor

No description provided.

@reactormonk
Copy link
Contributor Author

Works according to the build bots.

Varriount added a commit that referenced this pull request May 21, 2014
@Varriount Varriount merged commit c40f2d6 into devel May 21, 2014
@Araq Araq deleted the sigpipe branch November 6, 2014 01:39
Clyybber pushed a commit to Clyybber/Nim that referenced this pull request Feb 29, 2024
## Summary

Regarding overflow-check behaviour, `abs` is now treated the same as
any other procedure, meaning that whether or not overflow checks are
enabled at the `abs` callsite is ignored. This is a change in
behaviour for the C and JavaScript backends, but not for the VM
backend.

In addition, if an `abs` call is the only raising statement in a
scope, it raising an exception now properly invokes the destructor
for the relevant locals in the scope.

## Details

* `cgen` and `jsgen` treat `mAbsI` as a normal procedure (`vmgen`
  already did)
* the `abs` definitions in `system` are moved above the
  `{.push checks: off.}` pragma affecting them. This prevents them
  from having overflow checks unconditionally disabled
* `mirgen` uses a dedicated translation path for `mAbsI`, in order to
  pick a checked or unchecked call, based on whether overflow
  checks and panics are enabled

Calls to `abs` now using checked calls (if needed) makes the
exceptional control-flow visible at the MIR level and subsequently to
the data-flow analysis / destructor injection.

### Tests

* add a test case for ensuring proper destruction when only `abs`
  can raise
* enable `toverflow_abs` for the C target. The JS target still
  doesn't work, due to the improper 64-bit integer overflow check
  implementation
* change the expected output of `toverflow_abs` such that it also
  matches that of the C test
* `abs` for integers is not a generic procedure, the unnecessary
  "instantiation" in `toverflow_abs` is removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants